From 6060c43bee23ebae41edbe914ba991ebf0a96924 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 23 Nov 2026 18:55:57 +0100 Subject: 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> (and the graphic extras to Map entries), the summon payload to Map, room data lists/maps explicitly, and deck card lists to Map 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. --- server/lib/core/state/modifier_deck.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/lib/core/state/modifier_deck.dart') 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 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 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 newList = []; - for (final item in modifierDeckData[deckId] as List) { + for (final Map item in modifierDeckData[deckId] as List) { String gfx = item["gfx"]; gfx = gfx.replaceAll("-allies", ""); if (gfx == "curse") { -- cgit v1.3.1