Beispiel #1
0
 def test_not_equal(self):
     cell1 = Cell(1)
     cell2 = Cell(2)
     self.assertNotEqual(cell1, cell2)
Beispiel #2
0
 def get_cell(self, location):
     default_cell = Cell(location)
     if location.x % 2 == 1:
         default_cell.interactable = ScoreLocation(default_cell)
     return self._cell_cache.setdefault(location, default_cell)
Beispiel #3
0
 def test_equal(self):
     cell1 = Cell(1)
     cell2 = Cell(1)
     self.assertEqual(cell1, cell2)
Beispiel #4
0
 def get_cell(self, location):
     return self._cell_cache.setdefault(location, Cell(location))
Beispiel #5
0
 def get_cell(self, location):
     return Cell(location)
Beispiel #6
0
 def get_cell(self, location):
     if location not in self._cell_cache:
         cell = Cell(location)
         cell.avatar = self._avatar
         self._cell_cache[location] = cell
     return self._cell_cache[location]
Beispiel #7
0
 def get_cell(self, location):
     cell = Cell(location)
     cell.interactable = self._pickup
     return cell
Beispiel #8
0
 def _add_horizontal_layer(self, world_map, y):
     for x in range(world_map.min_x(), world_map.max_x() + 1):
         world_map.grid[Location(x, y)] = Cell(Location(x, y))
Beispiel #9
0
 def _add_vertical_layer(self, world_map, x):
     for y in range(world_map.min_y(), world_map.max_y() + 1):
         world_map.grid[Location(x, y)] = Cell(Location(x, y))
Beispiel #10
0
 def setup_cell(self, location):
     self._cell = Cell(location)
     self._cell.interactable = self._pickup_class(self._cell)
Beispiel #11
0
 def get_cell(self, location):
     default_cell = Cell(location, generates_score=(location.x % 2 == 1))
     return self._cell_cache.setdefault(location, default_cell)
Beispiel #12
0
 def get_cell(self, location):
     cell = Cell(location)
     cell.pickup = self._pickup
     return cell