diff options
Diffstat (limited to 'go/game/unit_test.go')
| -rw-r--r-- | go/game/unit_test.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/go/game/unit_test.go b/go/game/unit_test.go index deaeb5f6..fd9b95b4 100644 --- a/go/game/unit_test.go +++ b/go/game/unit_test.go @@ -17,20 +17,21 @@ symbols: S: street W: deep water ` - s := NewState() + s := NewLocalState() r := strings.NewReader(mapDef) - s.Map, _ = readMap(r) + m, _ := readMap(r) + s.SetMap(m) - s.AddNewPlayer("player", NewDeck()) - p := s.Players[0] + s.AddNewPlayer("player", NewDeck(), nil) + p := s.Players()[0] - f := NewUnit(NewCard("nautics/fisher"), s.Map.TileAt(Position{2, 2}), p) + 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}), p) + 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}), p) + sword := newEquipmentFromPath("base/sword", s.Map().TileAt(Position{0, 1}), p) s.addPermanent(sword) movePermanent(a, f.Tile()) @@ -61,11 +62,11 @@ symbols: t.Fatalf("Piled archer is attackable") } - if len(a.AttackableTiles(s.Map)) != 0 { + if len(a.AttackableTiles(s.Map())) != 0 { t.Fatalf("Piled archer has attackable tiles") } - movePermanent(a, s.Map.TileAt(Position{1, 1})) + movePermanent(a, s.Map().TileAt(Position{1, 1})) if len(f.Pile()) != 0 { t.Fatalf("fisher's pile is not empty") } |
