From 15b7e221b799ef107dec44ecdb294026dfd3d059 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 24 Jun 2026 22:55:35 -0400 Subject: refactor: pulled techs out to yaml files, unified numerous combat functions, broke up game object --- internal/game/condition_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'internal/game/condition_test.go') 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{ -- cgit v1.2.3