dmlary / morrow

Ruby ECS-based MUD server
MIT License
4 stars 1 forks source link

Exits component redesign #58

Closed dmlary closed 4 years ago

dmlary commented 4 years ago

Previously Exits contained references to "passage" entities that had a destination, and optionally a closable component. This caused a couple of issues:

So to fix both of these issues, I tossed out the idea of a passage.

For each direction from a room, the Exits component has a destination in that direction (entity id), and optionally a door entity that maintains the closable component for both sides of the door.

- id: example:room/1
  base: morrow:room
  components:
  - exits:
      east: example:room/2
      east_door: example:door/1-to-2

- id: example:room/2
  base: morrow:room
  components:
  - exits:
     west: example:room/1
     west_door: example:door/1-to-2

- id: example:door/1-to-2
  base: morrow:door/closed

fixes #12