Cells know what room they are in. What will it take to undo this? The bear gets really close to taking a bite today. The Cell still contains a pointer to its room, which is used to determine whether it is available, and which can be fetched and set directly: class Cell: @property def room(self): return self._room @room.setter def room(self, room): self._room = room @property def is_available(self) -> bool: return self.room is None @property def is_in_a_room(self): return not self.is_available We have methods corresponding to the latter two in DungeonLayout, if memory serves: class DungeonLayout: def is_available(self, xy): return not self.is_in_a_room(xy) def is_in_a_room(self, xy): cell = self.at(*xy) return any([cell in room for room in self.rooms]) It seems to me that there are at least two steps to clearing this up. One will be to ensure that all users of the is_available and is_in_a_room methods of Cell are unused, and the other will be to ensure that rooms are only set and…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.