diff options
Diffstat (limited to 'server/lib/core/game_methods.dart')
| -rw-r--r-- | server/lib/core/game_methods.dart | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/server/lib/core/game_methods.dart b/server/lib/core/game_methods.dart index cf43ab7..646a9f2 100644 --- a/server/lib/core/game_methods.dart +++ b/server/lib/core/game_methods.dart @@ -47,7 +47,7 @@ class GameMethods { static int getCoinValue({GameState? gameState}) { final gs = gameState ?? getIt<GameState>(); - int level = gs.level; + final int level = gs.level; if (level == _kCoinMaxLevel) { return _kCoinMaxValue; } @@ -162,7 +162,7 @@ class GameMethods { } static List<Character> getCurrentCharactersForState(GameState state) { - List<Character> characters = []; + final List<Character> characters = []; for (ListItemData data in state.currentList) { if (data is Character && !GameMethods.isObjectiveOrEscort(data.characterClass)) { @@ -291,7 +291,7 @@ class GameMethods { } static List<Monster> getCurrentMonsters({GameState? gameState}) { - List<Monster> monsters = []; + final List<Monster> monsters = []; final gs = gameState ?? getIt<GameState>(); for (ListItemData data in gs.currentList) { if (data is Monster) { @@ -304,7 +304,7 @@ class GameMethods { static int getNextAvailableBnBStandee(Monster data, {GameState? gameState}) { final gs = gameState ?? getIt<GameState>(); - int nrOfStandees = data.type.count; + final int nrOfStandees = data.type.count; for (int i = 0; i < nrOfStandees; i++) { bool isAvailable = true; for (final item in data.monsterInstances) { @@ -346,7 +346,7 @@ class GameMethods { nrOfStandees = _kPolarBearStandees; //for the special case where there are only 4 standees in first printing } - List<int> available = []; + final List<int> available = []; for (int i = 0; i < nrOfStandees; i++) { bool isAvailable = true; for (final item in data.monsterInstances) { @@ -400,7 +400,7 @@ class GameMethods { if (item.id == ownerId) { if (item is Monster) { for (final instance in item.monsterInstances) { - String id = + final String id = instance.name + instance.gfx + instance.standeeNr.toString(); if (id == figureId) { return instance; @@ -408,7 +408,7 @@ class GameMethods { } } else if (item is Character) { for (final instance in item.characterState.summonList) { - String id = + final String id = instance.name + instance.gfx + instance.standeeNr.toString(); if (id == figureId) { return instance; @@ -488,7 +488,7 @@ class GameMethods { GameState? gameState, }) { final gs = gameState ?? getIt<GameState>(); - String scenario = gs.scenario; + final String scenario = gs.scenario; if (edition == "Solo") { if (scenario.contains("${"#19"} ")) { return false; //this is forgotten circles @@ -584,7 +584,7 @@ class GameMethods { } static List<ModifierCard> getFactionCards(String faction) { - List<ModifierCard> retVal = []; + final List<ModifierCard> retVal = []; if (faction == "Demons") { retVal.add(ModifierCard(CardType.add, "Demons-perks/plus1any")); retVal.add( |
