X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=new2%2Fplomrogue%2Fmapping.py;h=2edbea84809acbfc759aed7993e603ffdb9c74e6;hb=a213ed788c8f305ea9c2192eabfb0d3562c8b2fa;hp=39aff658bee8682fa738244879166fe6f0c250fe;hpb=0d6e4ded54a3cff9ec068dc329796b781b9d7e16;p=plomrogue2-experiments diff --git a/new2/plomrogue/mapping.py b/new2/plomrogue/mapping.py index 39aff65..2edbea8 100644 --- a/new2/plomrogue/mapping.py +++ b/new2/plomrogue/mapping.py @@ -27,6 +27,12 @@ class MapGeometry(): directions += [name[5:]] return directions + def get_neighbors(self, pos): + neighbors = {} + for direction in self.get_directions(): + neighbors[direction] = self.move(pos, direction) + return neighbors + def move(self, start_pos, direction): mover = getattr(self, 'move_' + direction) target = mover(start_pos)