Example #1
0
 def test_cannot_move_to_habited_cell(self):
     target = Location(0, 0)
     cell = MockCell(target, avatar=DummyAvatar(target, 0))
     map = WorldMap({target: cell})
     target = Location(0, 0)
     self.assertFalse(map.can_move_to(target))
Example #2
0
 def test_cannot_move_to_cell_off_grid(self):
     map = WorldMap(self._generate_grid())
     target = Location(4, 1)
     self.assertFalse(map.can_move_to(target))
Example #3
0
 def test_cannot_move_to_uninhabitable_cell(self):
     target = Location(0, 0)
     cell = MockCell(target, habitable=False)
     map = WorldMap({target: cell})
     self.assertFalse(map.can_move_to(target))
Example #4
0
 def test_cannot_move_to_habited_cell(self):
     cells = self._generate_cells()
     cells[1]['avatar'] = self.AVATAR
     map = WorldMap(cells)
     self.assertFalse(map.can_move_to(Location(-1, 0)))
Example #5
0
 def test_can_move_to(self):
     map = WorldMap(self._generate_grid())
     target = Location(1, 1)
     self.assertTrue(map.can_move_to(target))
Example #6
0
 def test_cannot_move_to_uninhabitable_cell(self):
     cells = self._generate_cells()
     cells[0]['habitable'] = False
     map = WorldMap(cells)
     self.assertFalse(map.can_move_to(Location(-1, -1)))
Example #7
0
 def test_can_move_to(self):
     world_map = WorldMap(self._generate_grid(), self.settings)
     target = Location(1, 1)
     self.assertTrue(world_map.can_move_to(target))
Example #8
0
 def test_cannot_move_to_habited_cell(self):
     cells = self._generate_cells()
     cells[1]['avatar'] = self.AVATAR
     map = WorldMap(cells)
     self.assertFalse(map.can_move_to(Location(-1, 0)))
Example #9
0
 def test_cannot_move_to_uninhabitable_cell(self):
     cells = self._generate_cells()
     cells[0]['habitable'] = False
     map = WorldMap(cells)
     self.assertFalse(map.can_move_to(Location(-1, -1)))
Example #10
0
 def test_cannot_move_to_cell_off_grid(self):
     world_map = WorldMap(generate_grid(), self.settings)
     target = Location(4, 1)
     self.assertFalse(world_map.can_move_to(target))