aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-02-08 12:47:35 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:50:09 +0200
commitd37eb4f8e229db5cbf8fccdc71b1cb99096be3dc (patch)
tree1a08a4c88c4b08d15365c0aeb8bafda3bf3d2dac
parenta04e0872af77c962207c0298dd404120b7665ae8 (diff)
downloadmuhqs-game-d37eb4f8e229db5cbf8fccdc71b1cb99096be3dc.tar.gz
muhqs-game-d37eb4f8e229db5cbf8fccdc71b1cb99096be3dc.zip
add dummy player to unit tests
-rw-r--r--go/game/unit_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/go/game/unit_test.go b/go/game/unit_test.go
index 53b585d8..c4a92372 100644
--- a/go/game/unit_test.go
+++ b/go/game/unit_test.go
@@ -21,13 +21,16 @@ symbols:
r := strings.NewReader(mapDef)
s.Map, _ = readMap(r)
- f := NewUnit(NewCard("nautics/fisher"), s.Map.TileAt(Position{2, 2}), nil)
+ s.AddNewPlayer("player", NewDeck())
+ p := s.Players[0]
+
+ f := NewUnit(NewCard("nautics/fisher"), s.Map.TileAt(Position{2, 2}), p)
s.AddPermanent(f)
- a := NewUnit(NewCard("base/archer"), s.Map.TileAt(Position{1, 1}), nil)
+ a := NewUnit(NewCard("base/archer"), s.Map.TileAt(Position{1, 1}), p)
s.AddPermanent(a)
- sword := newEquipmentFromPath("base/sword", s.Map.TileAt(Position{0, 1}), nil)
+ sword := newEquipmentFromPath("base/sword", s.Map.TileAt(Position{0, 1}), p)
s.AddPermanent(sword)
a.move(s, f.Tile())