diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2026-11-23 20:09:13 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2026-11-23 20:09:13 +0100 |
| commit | 0530c7aa9473f9878e3fba86ed745de7d1056cf9 (patch) | |
| tree | fa57cb1bd6a5eebf19a653c425b5d56f67af96c3 /server/lib/core/state | |
| parent | c6c2ebfcd2bf6d30732ba9bbb0a4524a76bcbf05 (diff) | |
Diffstat (limited to 'server/lib/core/state')
| -rw-r--r-- | server/lib/core/state/game_save_state.dart | 2 | ||||
| -rw-r--r-- | server/lib/core/state/game_state.dart | 15 |
2 files changed, 7 insertions, 10 deletions
diff --git a/server/lib/core/state/game_save_state.dart b/server/lib/core/state/game_save_state.dart index e5f25ff..87886fa 100644 --- a/server/lib/core/state/game_save_state.dart +++ b/server/lib/core/state/game_save_state.dart @@ -21,7 +21,7 @@ class GameSaveState { final data = json.decode(_savedState ?? '') as Map<String, dynamic>; gameState._level = data['level'] as int; - gameState._scenario = data['scenario']; // as String; + gameState.scenario = data['scenario']; // as String; if (data.containsKey('toastMessage')) { gameState._toastMessage = data['toastMessage']; // as String; } 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<String>` scenario, which its tests wrote to in order to + /// bypass `SetScenarioCommand`'s side effects). + String scenario = ""; String _toastMessage = ""; bool _showAllyDeck = false; List<RoomMonsterData>? 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<String>` 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()) |
