self.set_task('WAIT')
self._last_task_result = None
self.unset_surroundings()
+ self.close_maps = ()
+
+ def _position_set(self, pos):
+ """For player we need to update .close_maps on every move via the
+ self.surroundings property method, to keep their reality
+ bubble in sync with their movement.
+
+ """
+ super()._position_set(pos)
+ if self.id_ == self.game.player_id:
+ if not hasattr(self, '_surroundings'):
+ self._surroundings = None
+ self.surroundings
def move_on_dijkstra_map(self, own_pos, targets):
visible_map = self.get_visible_map()
def surroundings(self):
if self._surroundings is not None:
return self._surroundings
- s = self.game.map_geometry.get_view(self.game.map_size,
- self.game.get_map,
- self._radius, self.view_offset)
+ s, close_maps = self.\
+ game.map_geometry.get_view_and_seen_maps(self.game.map_size,
+ self.game.get_map,
+ self._radius,
+ self.view_offset)
+ self.close_maps = close_maps
self._surroundings = s
return self._surroundings