projects
/
mudpy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert sample data to new style
[mudpy.git]
/
mudpy
/
misc.py
diff --git
a/mudpy/misc.py
b/mudpy/misc.py
index
170a4c3
..
b322afc
100644
(file)
--- a/
mudpy/misc.py
+++ b/
mudpy/misc.py
@@
-309,9
+309,9
@@
class Element:
def portals(self):
"""Map the portal directions for an area to neighbors."""
portals = {}
def portals(self):
"""Map the portal directions for an area to neighbors."""
portals = {}
- if re.match(r"""^area
:
-?\d+,-?\d+,-?\d+$""", self.key):
+ if re.match(r"""^area
\.
-?\d+,-?\d+,-?\d+$""", self.key):
coordinates = [(int(x))
coordinates = [(int(x))
- for x in self.key.split("
:")[
1].split(",")]
+ for x in self.key.split("
.")[-
1].split(",")]
offsets = dict(
(x,
self.universe.contents["mudpy.movement.%s" % x].get("vector")
offsets = dict(
(x,
self.universe.contents["mudpy.movement.%s" % x].get("vector")
@@
-319,7
+319,7
@@
class Element:
for portal in self.get("gridlinks"):
adjacent = map(lambda c, o: c + o,
coordinates, offsets[portal])
for portal in self.get("gridlinks"):
adjacent = map(lambda c, o: c + o,
coordinates, offsets[portal])
- neighbor = "area
:
" + ",".join(
+ neighbor = "area
.
" + ",".join(
[(str(x)) for x in adjacent]
)
if neighbor in self.universe.contents:
[(str(x)) for x in adjacent]
)
if neighbor in self.universe.contents: