summaryrefslogtreecommitdiff
path: root/server/lib/core/state
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/core/state')
-rw-r--r--server/lib/core/state/game_save_state.dart2
-rw-r--r--server/lib/core/state/game_state.dart15
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())