summaryrefslogtreecommitdiff
path: root/server/lib/core/state/game_save_state.dart
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/core/state/game_save_state.dart')
-rw-r--r--server/lib/core/state/game_save_state.dart18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/lib/core/state/game_save_state.dart b/server/lib/core/state/game_save_state.dart
index 331b3a8..57ddf30 100644
--- a/server/lib/core/state/game_save_state.dart
+++ b/server/lib/core/state/game_save_state.dart
@@ -27,7 +27,7 @@ class GameSaveState {
}
if (data.containsKey('scenarioSectionsAdded')) {
- List<Object?> scenarioSectionsAdded =
+ final List<Object?> scenarioSectionsAdded =
data['scenarioSectionsAdded'] as List<Object?>;
gameState._scenarioSectionsAdded.clear();
for (final item in scenarioSectionsAdded) {
@@ -78,7 +78,7 @@ class GameSaveState {
//main list — update existing objects in-place
final list = data['currentList'] as List;
- List<ListItemData> newList = [];
+ final List<ListItemData> newList = [];
for (Map<String, dynamic> item in list) {
if (item["noteRow"] == true) {
final String itemId = item["id"] as String;
@@ -133,10 +133,10 @@ class GameSaveState {
// Prototype has the full initialized card set; used only for nr lookups.
final proto = MonsterAbilityState(deckName);
- List<MonsterAbilityCardModel> newDrawList = [];
- List drawPile = item["drawPile"] as List;
+ final List<MonsterAbilityCardModel> newDrawList = [];
+ final List drawPile = item["drawPile"] as List;
for (final cardItem in drawPile) {
- int nr = cardItem["nr"];
+ final int nr = cardItem["nr"];
for (final card in proto._drawPile.getList()) {
if (card.nr == nr) {
newDrawList.add(card);
@@ -144,9 +144,9 @@ class GameSaveState {
}
}
}
- List<MonsterAbilityCardModel> newDiscardList = [];
+ final List<MonsterAbilityCardModel> newDiscardList = [];
for (final cardItem in item["discardPile"] as List) {
- int nr = cardItem["nr"];
+ final int nr = cardItem["nr"];
for (final card in proto._drawPile.getList()) {
if (card.nr == nr) {
newDiscardList.add(card);
@@ -192,7 +192,7 @@ class GameSaveState {
}
//////elements
- Map elementData = data['elementState'];
+ final Map elementData = data['elementState'];
for (final element in Elements.values) {
final raw = elementData[element.index.toString()] as int?;
final idx =
@@ -218,7 +218,7 @@ class GameSaveState {
void loadFromDisk(GameState gameState) {
//have to call after init or element state overridden
- String? data = getIt<SaveStore>().read();
+ final String? data = getIt<SaveStore>().read();
if (data != null) {
_savedState = data;
load(gameState);