本文整理汇总了Python中simulation.world_map.WorldMap.can_move_to方法的典型用法代码示例。如果您正苦于以下问题:Python WorldMap.can_move_to方法的具体用法?Python WorldMap.can_move_to怎么用?Python WorldMap.can_move_to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulation.world_map.WorldMap
的用法示例。
在下文中一共展示了WorldMap.can_move_to方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cannot_move_to_habited_cell
# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import can_move_to [as 别名]
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))
示例2: test_cannot_move_to_uninhabitable_cell
# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import can_move_to [as 别名]
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))
示例3: test_cannot_move_to_cell_off_grid
# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import can_move_to [as 别名]
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))
示例4: test_can_move_to
# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import can_move_to [as 别名]
def test_can_move_to(self):
map = WorldMap(self._generate_grid())
target = Location(1, 1)
self.assertTrue(map.can_move_to(target))
示例5: test_cannot_move_to_habited_cell
# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import can_move_to [as 别名]
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)))
示例6: test_cannot_move_to_uninhabitable_cell
# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import can_move_to [as 别名]
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)))