Ease of access for testing >>> wt = WaTor(WIDTH, HEIGHT) >>> planet = [ ... [None, None, None], ... [None, Entity(True, coords=(1, 1)), None] ... ] >>> wt.set_planet(planet) >>> wt.planet == planet True >>> wt.width
(self, planet: list[list[Entity | None]])
| 130 | self.set_planet(self.planet) |
| 131 | |
| 132 | def set_planet(self, planet: list[list[Entity | None]]) -> None: |
| 133 | """ |
| 134 | Ease of access for testing |
| 135 | |
| 136 | >>> wt = WaTor(WIDTH, HEIGHT) |
| 137 | >>> planet = [ |
| 138 | ... [None, None, None], |
| 139 | ... [None, Entity(True, coords=(1, 1)), None] |
| 140 | ... ] |
| 141 | >>> wt.set_planet(planet) |
| 142 | >>> wt.planet == planet |
| 143 | True |
| 144 | >>> wt.width |
| 145 | 3 |
| 146 | >>> wt.height |
| 147 | 2 |
| 148 | """ |
| 149 | self.planet = planet |
| 150 | self.width = len(planet[0]) |
| 151 | self.height = len(planet) |
| 152 | |
| 153 | def add_entity(self, prey: bool) -> None: |
| 154 | """ |