home
·
contact
·
privacy
projects
/
plomrogue2-experiments
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add FLATTEN_SURROUNDINGS task.
[plomrogue2-experiments]
/
new2
/
plomrogue
/
mapping.py
diff --git
a/new2/plomrogue/mapping.py
b/new2/plomrogue/mapping.py
index 39aff658bee8682fa738244879166fe6f0c250fe..2edbea84809acbfc759aed7993e603ffdb9c74e6 100644
(file)
--- a/
new2/plomrogue/mapping.py
+++ b/
new2/plomrogue/mapping.py
@@
-27,6
+27,12
@@
class MapGeometry():
directions += [name[5:]]
return directions
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)
def move(self, start_pos, direction):
mover = getattr(self, 'move_' + direction)
target = mover(start_pos)