To remind you how it was done in ROM:
tables.c does not hold any information regarding exit directions. I would have expected there to be a table that matches
DIR_NORTH with a string
north and so on.
I tried the enum class but didn’t like the resulting code because I was unable to use the enum class values as keys to std::map and other containers. It would make some sense to have a possibility to iterate over all exit directions and quickly fetch their respective string representation. It could also make sense to represent exit directions as single bits, so they could meaningfully be added together in order to indicate rooms with multiple exits.
DIR_NORTH 1 DIR_SOUTH 2 DIR_EAST 4 DIR_WEST 8
Here a room that has exits to the north, east and west would have its exits bitmap set to 13. It turns useful in procedural labyrinth generation as explained here:
My current approach as an architect to a whole new MUD engine is to work around this problem by discarding the concept of hardcoded exit directions, making it theoretically possible to have any number of exits from a room in a way that each exit is represented by its own data structure. To get the list of neighboring rooms I would not iterate over a fixed set of exit directions but the container of references to exit data structures. Each of them could have a name such as
north but is not limited to 6 directions even though I intend to only use the common 6 directions all the time everywhere.