def testGetRandomEmptySector(self): """ """ coordinates: Coordinates = Coordinates(1, 1) quadrant: Quadrant = Quadrant(coordinates=coordinates) sector: Sector = quadrant.getRandomEmptySector() self.assertIsNotNone(sector, "Gotta get a sector back") self.assertEqual(sector.type, SectorType.EMPTY, "sector should be empty") self.logger.info(f'retrieved sector: {sector}')
def _createGalaxy(self): self.quadrants = [] for y in range(GALAXY_ROWS): quadrantRow: QuadrantRow = QuadrantRow([]) for x in range(GALAXY_COLUMNS): coordinates = Coordinates(x, y) quadrant = Quadrant(coordinates) quadrantRow.append(quadrant) if self._gameSettings.debugAnnounceQuadrantCreation is True: self.logger.debug(f"Created quadrant: ({x},{y})") self.quadrants.append(quadrantRow)
def testInitialization(self): coordinates: Coordinates = Coordinates(1, 1) quadrant: Quadrant = Quadrant(coordinates=coordinates) self.assertIsNotNone(quadrant, 'Should initialize')