aboutsummaryrefslogtreecommitdiff
path: root/internal/world/room.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-09 05:59:20 -0400
committerhistoria <[not public]>2026-06-09 05:59:20 -0400
commit9eb5ab1818b6b19501fd7209db1987c9e06cc919 (patch)
tree76e046b0bf611dfe939a8c8f6507467de2e9e20f /internal/world/room.go
downloadthehouseoficarus-9eb5ab1818b6b19501fd7209db1987c9e06cc919.tar.gz
first commit
Diffstat (limited to 'internal/world/room.go')
-rw-r--r--internal/world/room.go53
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"`
+}