diff options
| author | historia <[not public]> | 2026-06-25 15:40:48 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-25 15:40:48 -0400 |
| commit | abd612c15799f604e671e83dc7c410ed2b44185f (patch) | |
| tree | 0597ca92350de73aac2a7cf26b2f2d6595dac0cc /internal/behavior/desc.go | |
| parent | 2725e2927a1595c7b100d942d1f14146252adeb7 (diff) | |
| download | thehouseoficarus-abd612c15799f604e671e83dc7c410ed2b44185f.tar.gz | |
slop refactor
Diffstat (limited to 'internal/behavior/desc.go')
| -rw-r--r-- | internal/behavior/desc.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/behavior/desc.go b/internal/behavior/desc.go new file mode 100644 index 0000000..ca4bf69 --- /dev/null +++ b/internal/behavior/desc.go @@ -0,0 +1,27 @@ +package behavior + +import "gopkg.in/yaml.v3" + +type DescVariant struct { + Text string `yaml:"text"` + Condition *Condition `yaml:"condition,omitempty"` +} + +type DescList []DescVariant + +func (dl *DescList) UnmarshalYAML(value *yaml.Node) error { + if value.Kind == yaml.ScalarNode { + var s string + if err := value.Decode(&s); err != nil { + return err + } + *dl = DescList{{Text: s}} + return nil + } + var entries []DescVariant + if err := value.Decode(&entries); err != nil { + return err + } + *dl = entries + return nil +} |
