当前位置: 首页>>代码示例>>Python>>正文


Python WorldMap.score_cells方法代码示例

本文整理汇总了Python中simulation.world_map.WorldMap.score_cells方法的典型用法代码示例。如果您正苦于以下问题:Python WorldMap.score_cells方法的具体用法?Python WorldMap.score_cells怎么用?Python WorldMap.score_cells使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在simulation.world_map.WorldMap的用法示例。


在下文中一共展示了WorldMap.score_cells方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_scores_not_added_when_at_target

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
 def test_scores_not_added_when_at_target(self):
     world_map.TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR = 1
     grid = self._generate_grid()
     grid[Location(0, 1)].generates_score = True
     map = WorldMap(grid)
     map.update(1)
     self.assertEqual(len(list(map.score_cells())), 1)
     self.assertIn(grid[Location(0, 1)], map.score_cells())
开发者ID:ChrisMukherjee,项目名称:aimmo,代码行数:10,代码来源:test_world_map.py

示例2: test_score_despawn_chance

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
 def test_score_despawn_chance(self):
     world_map.TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR = 0
     grid = self._generate_grid()
     grid[Location(0, 1)].generates_score = True
     map = WorldMap(grid)
     map.update(1)
     self.assertIn(grid[Location(0, 1)], map.score_cells())
     self.assertEqual(len(list(map.score_cells())), 1)
开发者ID:ChrisMukherjee,项目名称:aimmo,代码行数:10,代码来源:test_world_map.py

示例3: test_scores_added

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
    def test_scores_added(self):
        world_map.TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR = 1
        map = WorldMap(self._generate_grid())
        map.update(1)
        self.assertEqual(len(list(map.score_cells())), 1)

        map.update(2)
        self.assertEqual(len(list(map.score_cells())), 2)
开发者ID:ChrisMukherjee,项目名称:aimmo,代码行数:10,代码来源:test_world_map.py

示例4: test_no_score_cells_generated_if_no_suitable_cells

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
 def test_no_score_cells_generated_if_no_suitable_cells(self):
     world_map.TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR = 1
     grid = self._generate_grid(1, 1)
     grid[Location(0, 0)].avatar = 'avatar'
     map = WorldMap(grid)
     map.update(1)
     self.assertEqual(len(list(map.score_cells())), 0)
开发者ID:ChrisMukherjee,项目名称:aimmo,代码行数:9,代码来源:test_world_map.py

示例5: test_not_enough_score_space

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
 def test_not_enough_score_space(self):
     world_map.TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR = 1
     grid = self._generate_grid(1)
     grid = [[MockCell(avatar='avatar')]]
     map = WorldMap(grid)
     map.reconstruct_interactive_state(1)
     self.assertEqual(len(list(map.score_cells())), 0)
开发者ID:joshuablake,项目名称:aimmo,代码行数:9,代码来源:test_world_map.py

示例6: test_scores_removed

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
 def test_scores_removed(self):
     world_map.SCORE_DESPAWN_CHANCE = 1
     grid = self._generate_grid()
     grid[Location(0, 1)].generates_score = True
     map = WorldMap(grid)
     map.update(1)
     self.assertEqual(len(list(map.score_cells())), 0)
开发者ID:ChrisMukherjee,项目名称:aimmo,代码行数:9,代码来源:test_world_map.py

示例7: test_scores_removed

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
 def test_scores_removed(self):
     world_map.SCORE_DESPAWN_CHANCE = 1
     grid = self._generate_grid()
     grid[0][1].generates_score = True
     map = WorldMap(grid)
     map.reconstruct_interactive_state(1)
     self.assertEqual(len(list(map.score_cells())), 0)
开发者ID:joshuablake,项目名称:aimmo,代码行数:9,代码来源:test_world_map.py

示例8: test_scores_not_added_when_at_target

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
 def test_scores_not_added_when_at_target(self):
     world_map.TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR = 1
     grid = self._generate_grid()
     grid[0][1].generates_score = True
     map = WorldMap(grid)
     map.reconstruct_interactive_state(1)
     self.assertEqual(len(list(map.score_cells())), 1)
     self.assertIn(grid[0][1], map.score_cells())
开发者ID:joshuablake,项目名称:aimmo,代码行数:10,代码来源:test_world_map.py

示例9: test_score_despawn_chance

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
 def test_score_despawn_chance(self):
     world_map.TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR = 0
     grid = self._generate_grid()
     grid[0][1].generates_score = True
     map = WorldMap(grid)
     map.reconstruct_interactive_state(1)
     self.assertIn(grid[0][1], map.score_cells())
     self.assertEqual(len(list(map.score_cells())), 1)
开发者ID:joshuablake,项目名称:aimmo,代码行数:10,代码来源:test_world_map.py

示例10: test_score_cells

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
 def test_score_cells(self):
     score_cell1 = MockCell(generates_score=True)
     score_cell2 = MockCell(generates_score=True)
     no_score_cell = MockCell()
     grid = self._grid_from_list([[score_cell1, no_score_cell], [no_score_cell, score_cell2]])
     map = WorldMap(grid)
     cells = list(map.score_cells())
     self.assertIn(score_cell1, cells)
     self.assertIn(score_cell2, cells)
     self.assertEqual(len(cells), 2, "Non-scoring cells present")
开发者ID:ChrisMukherjee,项目名称:aimmo,代码行数:12,代码来源:test_world_map.py

示例11: test_score_cells

# 需要导入模块: from simulation.world_map import WorldMap [as 别名]
# 或者: from simulation.world_map.WorldMap import score_cells [as 别名]
 def test_score_cells(self):
     cells = self._generate_cells()
     cells[0]['generates_score'] = True
     cells[5]['generates_score'] = True
     map = WorldMap(cells)
     self.assertLocationsEqual(map.score_cells(), (Location(-1, -1), Location(0, 1)))
开发者ID:ChrisMukherjee,项目名称:aimmo,代码行数:8,代码来源:test_world_map.py


注:本文中的simulation.world_map.WorldMap.score_cells方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。