def test_not_equal(self): cell1 = Cell(1) cell2 = Cell(2) self.assertNotEqual(cell1, cell2)
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)
def test_equal(self): cell1 = Cell(1) cell2 = Cell(1) self.assertEqual(cell1, cell2)
def get_cell(self, location): return self._cell_cache.setdefault(location, Cell(location))
def get_cell(self, location): return Cell(location)
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]
def get_cell(self, location): cell = Cell(location) cell.interactable = self._pickup return cell
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))
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))
def setup_cell(self, location): self._cell = Cell(location) self._cell.interactable = self._pickup_class(self._cell)
def get_cell(self, location): default_cell = Cell(location, generates_score=(location.x % 2 == 1)) return self._cell_cache.setdefault(location, default_cell)
def get_cell(self, location): cell = Cell(location) cell.pickup = self._pickup return cell