From 0530c7aa9473f9878e3fba86ed745de7d1056cf9 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 23 Nov 2026 20:09:13 +0100 Subject: server: replace the scenario getter/setter with a direct field --- server/lib/core/state/game_state.dart | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'server/lib/core/state/game_state.dart') diff --git a/server/lib/core/state/game_state.dart b/server/lib/core/state/game_state.dart index 903cc51..c57f03c 100644 --- a/server/lib/core/state/game_state.dart +++ b/server/lib/core/state/game_state.dart @@ -65,7 +65,10 @@ class GameState { bool _autoScenarioLevel = false; bool _allyDeckInOGGloom = true; int _difficulty = 1; - String _scenario = ""; + /// Direct set for tests (mirrors the reference app's writable + /// `ValueNotifier` scenario, which its tests wrote to in order to + /// bypass `SetScenarioCommand`'s side effects). + String scenario = ""; String _toastMessage = ""; bool _showAllyDeck = false; List? pendingAutoAddDialog; @@ -95,12 +98,6 @@ class GameState { bool get allyDeckInOGGloom => _allyDeckInOGGloom; int get difficulty => _difficulty; String get toastMessage => _toastMessage; - String get scenario => _scenario; - - /// Direct set for tests (mirrors the reference app's writable - /// `ValueNotifier` scenario, which its tests wrote to in order to - /// bypass `SetScenarioCommand`'s side effects). - set scenario(String value) => _scenario = value; bool get showAllyDeck => _showAllyDeck; int get scenarioSectionsVersion => _scenarioSectionsVersion; @@ -212,7 +209,7 @@ class GameState { } void setScenario(_StateModifier _, String value) { - _scenario = value; + scenario = value; } void setToastMessage(_StateModifier _, String value) { @@ -235,7 +232,7 @@ class GameState { 'roundState': _roundState.index, 'round': _round, 'totalRounds': _totalRounds, - 'scenario': _scenario, + 'scenario': scenario, 'toastMessage': _toastMessage, 'scenarioSpecialRules': _scenarioSpecialRules .map((r) => r.toJson()) -- cgit v1.3.1