diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2026-11-23 18:55:57 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2026-11-23 18:55:57 +0100 |
| commit | 6060c43bee23ebae41edbe914ba991ebf0a96924 (patch) | |
| tree | a7057786b91e25048eb1eb47f960dcb33ecbbbc1 /server/lib/core/state/modifier_deck.dart | |
| parent | 7ee14396b1f1f96ed0472b5949ce82a7f9313276 (diff) | |
server: type the JSON parsing boundaries (avoid_dynamic_calls)
Give the decoded JSON values a static type before use: cast the
monster-ability card list to List<List<Object?>> (and the graphic
extras to Map entries), the summon payload to Map<String, dynamic>,
room data lists/maps explicitly, and deck card lists to
Map<String, dynamic> loop variables. The test assertions on the
settings payload get the same treatment. Also drops two stale
ignore comments (wrong lint code) and a redundant nested assignment.
Diffstat (limited to 'server/lib/core/state/modifier_deck.dart')
| -rw-r--r-- | server/lib/core/state/modifier_deck.dart | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/core/state/modifier_deck.dart b/server/lib/core/state/modifier_deck.dart index d50131f..ab34279 100644 --- a/server/lib/core/state/modifier_deck.dart +++ b/server/lib/core/state/modifier_deck.dart @@ -99,7 +99,7 @@ class ModifierDeck { } _needsShuffle = false; - for (final item in modifierDeckData["drawPile"] as List) { + for (final Map<String, dynamic> item in modifierDeckData["drawPile"] as List) { final String gfx = item["gfx"]; if (gfx == "curse" || gfx.contains("empower") || @@ -108,7 +108,7 @@ class ModifierDeck { addRemovableValue(_StateModifier(), gfx, 1); } } - for (final item in modifierDeckData["discardPile"] as List) { + for (final Map<String, dynamic> item in modifierDeckData["discardPile"] as List) { final String gfx = item["gfx"]; if (_isMultiplyType(gfx)) { _needsShuffle = true; @@ -589,7 +589,7 @@ class ModifierDeck { String deckId, ) { final List<ModifierCard> newList = []; - for (final item in modifierDeckData[deckId] as List) { + for (final Map<String, dynamic> item in modifierDeckData[deckId] as List) { String gfx = item["gfx"]; gfx = gfx.replaceAll("-allies", ""); if (gfx == "curse") { |
