diff options
| author | historia <[not public]> | 2026-06-24 22:55:35 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-24 22:55:35 -0400 |
| commit | 15b7e221b799ef107dec44ecdb294026dfd3d059 (patch) | |
| tree | 3748e464a77f0f082bea1567e9d6990052054961 /internal/game/condition_test.go | |
| parent | 9d4b799db4868bcab291b83599ff088763cd4ed6 (diff) | |
| download | thehouseoficarus-15b7e221b799ef107dec44ecdb294026dfd3d059.tar.gz | |
refactor: pulled techs out to yaml files, unified numerous combat functions, broke up game object
Diffstat (limited to 'internal/game/condition_test.go')
| -rw-r--r-- | internal/game/condition_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/internal/game/condition_test.go b/internal/game/condition_test.go index 5e5967d..d932d18 100644 --- a/internal/game/condition_test.go +++ b/internal/game/condition_test.go @@ -39,7 +39,7 @@ func TestIsTruthy(t *testing.T) { } func TestCheckConditionPlayerFlagTruthy(t *testing.T) { - g := &Game{WorldFlags: map[string]any{}} + g := &Game{Flags: NewFlagStore()} set := sessWithFlags(map[string]any{"x": true}) unset := sessWithFlags(map[string]any{}) @@ -73,7 +73,7 @@ func TestCheckConditionPlayerFlagTruthy(t *testing.T) { } func TestCheckConditionValueComparisonPreserved(t *testing.T) { - g := &Game{WorldFlags: map[string]any{}} + g := &Game{Flags: NewFlagStore()} sess := sessWithFlags(map[string]any{"n": 1}) if !g.checkCondition(sess, &action.Condition{PlayerFlag: "n", Value: 1}) { @@ -88,7 +88,8 @@ func TestCheckConditionValueComparisonPreserved(t *testing.T) { } func TestCheckConditionWorldFlag(t *testing.T) { - g := &Game{WorldFlags: map[string]any{"gate_open": true}} + g := &Game{Flags: NewFlagStore()} + g.Flags.Set("gate_open", true) sess := sessWithFlags(map[string]any{}) if !g.checkCondition(sess, &action.Condition{Flag: "gate_open"}) { @@ -103,7 +104,7 @@ func TestCheckConditionWorldFlag(t *testing.T) { } func TestResolveObjDescPresence(t *testing.T) { - g := &Game{WorldFlags: map[string]any{}} + g := &Game{Flags: NewFlagStore()} def := &object.ObjectDef{ Descriptions: []object.ConditionalDesc{ @@ -139,7 +140,7 @@ func TestResolveObjDescPresence(t *testing.T) { } func TestRoomDescriptionSelection(t *testing.T) { - g := &Game{WorldFlags: map[string]any{}} + g := &Game{Flags: NewFlagStore()} room := &world.Room{ Description: "empty pad", Descriptions: []world.RoomDesc{ |
