Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 def test_pickup_spawn_chance(self):
     world_map.TARGET_NUM_PICKUPS_PER_AVATAR = 5
     world_map.PICKUP_SPAWN_CHANCE = 0
     grid = self._generate_grid()
     map = WorldMap(grid)
     map.reconstruct_interactive_state(1)
     self.assertEqual(len(list(map.pickup_cells())), 0)
Exemplo n.º 4
0
 def test_not_enough_pickup_space(self):
     world_map.TARGET_NUM_PICKUPS_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.pickup_cells())), 0)
Exemplo n.º 5
0
 def test_pickup_spawn_chance(self):
     world_map.TARGET_NUM_PICKUPS_PER_AVATAR = 5
     world_map.PICKUP_SPAWN_CHANCE = 0
     grid = self._generate_grid()
     map = WorldMap(grid)
     map.reconstruct_interactive_state(1)
     self.assertEqual(len(list(map.pickup_cells())), 0)
Exemplo n.º 6
0
 def test_not_enough_pickup_space(self):
     world_map.TARGET_NUM_PICKUPS_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.pickup_cells())), 0)
Exemplo n.º 7
0
    def test_scores_added(self):
        world_map.TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR = 1
        map = WorldMap(self._generate_grid())
        map.reconstruct_interactive_state(1)
        self.assertEqual(len(list(map.score_cells())), 1)

        map.reconstruct_interactive_state(2)
        self.assertEqual(len(list(map.score_cells())), 2)
Exemplo n.º 8
0
 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)
Exemplo n.º 9
0
 def test_pickups_not_added_when_at_target(self):
     world_map.TARGET_NUM_PICKUPS_PER_AVATAR = 1
     grid = self._generate_grid()
     grid[0][1].pickup = True
     map = WorldMap(grid)
     map.reconstruct_interactive_state(1)
     self.assertEqual(len(list(map.pickup_cells())), 1)
     self.assertIn(grid[0][1], map.pickup_cells())
Exemplo n.º 10
0
 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())
Exemplo n.º 11
0
    def test_scores_added(self):
        world_map.TARGET_NUM_SCORE_LOCATIONS_PER_AVATAR = 1
        map = WorldMap(self._generate_grid())
        map.reconstruct_interactive_state(1)
        self.assertEqual(len(list(map.score_cells())), 1)

        map.reconstruct_interactive_state(2)
        self.assertEqual(len(list(map.score_cells())), 2)
Exemplo n.º 12
0
 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)
Exemplo n.º 13
0
 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())
Exemplo n.º 14
0
    def test_grid_expand(self):
        world_map.TARGET_NUM_CELLS_PER_AVATAR = 5
        map = WorldMap(self._generate_grid())
        map.reconstruct_interactive_state(1)
        self.assertGridSize(map, 3)

        map.reconstruct_interactive_state(2)
        self.assertGridSize(map, 4)
Exemplo n.º 15
0
    def test_grid_expand(self):
        world_map.TARGET_NUM_CELLS_PER_AVATAR = 5
        map = WorldMap(self._generate_grid())
        map.reconstruct_interactive_state(1)
        self.assertGridSize(map, 3)

        map.reconstruct_interactive_state(2)
        self.assertGridSize(map, 4)
Exemplo n.º 16
0
 def test_pickups_not_added_when_at_target(self):
     world_map.TARGET_NUM_PICKUPS_PER_AVATAR = 1
     grid = self._generate_grid()
     grid[0][1].pickup = True
     map = WorldMap(grid)
     map.reconstruct_interactive_state(1)
     self.assertEqual(len(list(map.pickup_cells())), 1)
     self.assertIn(grid[0][1], map.pickup_cells())
Exemplo n.º 17
0
    def test_pickups_added(self):
        world_map.TARGET_NUM_PICKUPS_PER_AVATAR = 1
        world_map.PICKUP_SPAWN_CHANCE = 1
        map = WorldMap(self._generate_grid())
        map.reconstruct_interactive_state(1)
        self.assertEqual(len(list(map.pickup_cells())), 1)

        map.reconstruct_interactive_state(2)
        self.assertEqual(len(list(map.pickup_cells())), 2)
Exemplo n.º 18
0
    def test_pickups_added(self):
        world_map.TARGET_NUM_PICKUPS_PER_AVATAR = 1
        world_map.PICKUP_SPAWN_CHANCE = 1
        map = WorldMap(self._generate_grid())
        map.reconstruct_interactive_state(1)
        self.assertEqual(len(list(map.pickup_cells())), 1)

        map.reconstruct_interactive_state(2)
        self.assertEqual(len(list(map.pickup_cells())), 2)