aboutsummaryrefslogtreecommitdiff
path: root/internal/world
diff options
context:
space:
mode:
Diffstat (limited to 'internal/world')
-rw-r--r--internal/world/room.go21
1 files changed, 9 insertions, 12 deletions
diff --git a/internal/world/room.go b/internal/world/room.go
index 6c2d0e3..58fa82b 100644
--- a/internal/world/room.go
+++ b/internal/world/room.go
@@ -1,6 +1,9 @@
package world
-import "gopkg.in/yaml.v3"
+import (
+ "gopkg.in/yaml.v3"
+ "thirdcollapse/internal/action"
+)
type ExitDir string
@@ -44,9 +47,9 @@ type SpawnDef struct {
}
type ExitDef struct {
- Room int `yaml:"room"`
- Condition *ExitCondition `yaml:"condition"`
- BlockedMessage string `yaml:"blocked_message"`
+ Room int `yaml:"room"`
+ Condition *action.Condition `yaml:"condition"`
+ BlockedMessage string `yaml:"blocked_message"`
}
func (e *ExitDef) UnmarshalYAML(value *yaml.Node) error {
@@ -62,12 +65,6 @@ func (e *ExitDef) UnmarshalYAML(value *yaml.Node) error {
return value.Decode((*raw)(e))
}
-type ExitCondition struct {
- Flag string `yaml:"flag"`
- Value any `yaml:"value"`
- Not bool `yaml:"not"`
-}
-
type Room struct {
ID int `yaml:"id"`
Name string `yaml:"name"`
@@ -81,8 +78,8 @@ type Room struct {
}
type EnterStep struct {
- Message string `yaml:"message"`
- Condition *ExitCondition `yaml:"condition"`
+ Message string `yaml:"message"`
+ Condition *action.Condition `yaml:"condition"`
}
type RoomObject struct {