diff options
| author | historia <[not public]> | 2026-06-09 05:59:20 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-09 05:59:20 -0400 |
| commit | 9eb5ab1818b6b19501fd7209db1987c9e06cc919 (patch) | |
| tree | 76e046b0bf611dfe939a8c8f6507467de2e9e20f /internal/world/room.go | |
| download | thehouseoficarus-9eb5ab1818b6b19501fd7209db1987c9e06cc919.tar.gz | |
first commit
Diffstat (limited to 'internal/world/room.go')
| -rw-r--r-- | internal/world/room.go | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/internal/world/room.go b/internal/world/room.go new file mode 100644 index 0000000..a92a428 --- /dev/null +++ b/internal/world/room.go @@ -0,0 +1,53 @@ +package world + +type ExitDir string + +const ( + North ExitDir = "north" + South ExitDir = "south" + East ExitDir = "east" + West ExitDir = "west" + Up ExitDir = "up" + Down ExitDir = "down" +) + +var ExitAliases = map[string]ExitDir{ + "n": North, + "s": South, + "e": East, + "w": West, + "u": Up, + "d": Down, +} + +var OppositeExit = map[ExitDir]ExitDir{ + North: South, + South: North, + East: West, + West: East, + Up: Down, + Down: Up, +} + +var ExitOrder = []ExitDir{ + "northwest", North, "northeast", + East, "southeast", South, "southwest", + West, Up, Down, +} + +type SpawnDef struct { + ItemID string `yaml:"item_id"` + Quantity int `yaml:"quantity"` + RespawnTicks int `yaml:"respawn_ticks"` +} + +type Room struct { + ID int `yaml:"id"` + Name string `yaml:"name"` + Description string `yaml:"description"` + MapSymbol string `yaml:"map_symbol"` + Exits map[ExitDir]int `yaml:"exits"` + Objects []string `yaml:"objects"` + Spawns []SpawnDef `yaml:"spawns"` + Mobs []string `yaml:"mobs"` +} |
