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))
- 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")
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:
_desc: This is a set of sample locations for testing and demonstration
purposes.
-area:-1,0,0:
- description: This is the West Sample Location. It is merely provided as an example of what an area might look like.
- gridlinks: ['east']
- name: West Sample Location
- terrain: inside
-
-area:0,-1,0:
- description: This is the South Sample Location. It is merely provided as an example of what an area might look like.
- gridlinks: ['north']
- name: South Sample Location
- terrain: inside
-
-area:0,0,-1:
- description: This is the Lower Sample Location. It is merely provided as an example of what an area might look like.
- gridlinks: ['up']
- name: Lower Sample Location
- terrain: inside
-
-area:0,0,0:
- description: This is the Center Sample Location. It is merely provided as an example of what an area might look like.
- gridlinks: ['down', 'east', 'north', 'south', 'up', 'west']
- name: Center Sample Location
- terrain: inside
-
-area:0,0,1:
- description: This is the Upper Sample Location. It is merely provided as an example of what an area might look like.
- gridlinks: ['down']
- name: Upper Sample Location
- terrain: inside
-
-area:0,1,0:
- description: This is the North Sample Location. It is merely provided as an example of what an area might look like.
- gridlinks: ['south']
- name: North Sample Location
- terrain: inside
-
-area:1,0,0:
- description: This is the East Sample Location. It is merely provided as an example of what an area might look like.
- gridlinks: ['west']
- name: East Sample Location
- terrain: inside
+area.-1,0,0.description: This is the West Sample Location. It is merely provided as an example of what an area might look like.
+area.-1,0,0.gridlinks: ['east']
+area.-1,0,0.name: West Sample Location
+area.-1,0,0.terrain: inside
+
+area.0,-1,0.description: This is the South Sample Location. It is merely provided as an example of what an area might look like.
+area.0,-1,0.gridlinks: ['north']
+area.0,-1,0.name: South Sample Location
+area.0,-1,0.terrain: inside
+
+area.0,0,-1.description: This is the Lower Sample Location. It is merely provided as an example of what an area might look like.
+area.0,0,-1.gridlinks: ['up']
+area.0,0,-1.name: Lower Sample Location
+area.0,0,-1.terrain: inside
+
+area.0,0,0.description: This is the Center Sample Location. It is merely provided as an example of what an area might look like.
+area.0,0,0.gridlinks: ['down', 'east', 'north', 'south', 'up', 'west']
+area.0,0,0.name: Center Sample Location
+area.0,0,0.terrain: inside
+
+area.0,0,1.description: This is the Upper Sample Location. It is merely provided as an example of what an area might look like.
+area.0,0,1.gridlinks: ['down']
+area.0,0,1.name: Upper Sample Location
+area.0,0,1.terrain: inside
+
+area.0,1,0.description: This is the North Sample Location. It is merely provided as an example of what an area might look like.
+area.0,1,0.gridlinks: ['south']
+area.0,1,0.name: North Sample Location
+area.0,1,0.terrain: inside
+
+area.1,0,0.description: This is the East Sample Location. It is merely provided as an example of what an area might look like.
+area.1,0,0.gridlinks: ['west']
+area.1,0,0.name: East Sample Location
+area.1,0,0.terrain: inside