summaryrefslogtreecommitdiff
path: root/server/lib/core/state/game_state.dart
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2026-11-23 20:09:13 +0100
committerJoel Klinghed <the_jk@spawned.biz>2026-11-23 20:09:13 +0100
commit0530c7aa9473f9878e3fba86ed745de7d1056cf9 (patch)
treefa57cb1bd6a5eebf19a653c425b5d56f67af96c3 /server/lib/core/state/game_state.dart
parentc6c2ebfcd2bf6d30732ba9bbb0a4524a76bcbf05 (diff)
server: replace the scenario getter/setter with a direct fieldHEADmain
Diffstat (limited to 'server/lib/core/state/game_state.dart')
-rw-r--r--server/lib/core/state/game_state.dart15
1 files changed, 6 insertions, 9 deletions
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())