I just want to do a little more this afternoon. Can we move at_offset yet? Yes. Just one more use of current remains. We were part-way through dealing with Cell.at_offset when a revert became more desirable than slogging through changes that felt sticky. With some other matters now dealt with, let’s try again. Here are the criminal and its collaborators: class Cell: def at_offset(self, dx, dy): from dungeonlayout import current return current.at_offset(self.xy, (dx, dy)) def east(self): return self.attempt_move(1,0) def north(self): return self.attempt_move(0, -1) def south(self): return self.attempt_move(0, 1) def west(self): return self.attempt_move(-1, 0) def attempt_move(self, dx, dy): cell = self.at_offset(dx, dy) if not cell or cell.is_available: return self return cell Those come from Dungeon class, which we haven’t done much with yet: class Dungeon: def move_adventurer_north(self): self.place_player_at(self.player_cell.north()) def move_adventurer_east(self):…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.