diff options
Diffstat (limited to 'server/lib/core/commands')
20 files changed, 27 insertions, 27 deletions
diff --git a/server/lib/core/commands/add_condition_command.dart b/server/lib/core/commands/add_condition_command.dart index 663d6b0..a352abc 100644 --- a/server/lib/core/commands/add_condition_command.dart +++ b/server/lib/core/commands/add_condition_command.dart @@ -18,9 +18,9 @@ class AddConditionCommand extends Command { @override void execute() { - FigureState? figure = GameMethods.getFigure(ownerId, figureId); + final FigureState? figure = GameMethods.getFigure(ownerId, figureId); if (figure != null) { - List<Condition> newList = []; + final List<Condition> newList = []; newList.addAll(figure.conditions); if (!newList.contains(condition) || //block from adding same condition condition == Condition.chill || diff --git a/server/lib/core/commands/add_cs_party_card_command.dart b/server/lib/core/commands/add_cs_party_card_command.dart index 4f59e4b..2628d03 100644 --- a/server/lib/core/commands/add_cs_party_card_command.dart +++ b/server/lib/core/commands/add_cs_party_card_command.dart @@ -15,7 +15,7 @@ class AddCSPartyCardCommand extends Command { @override void execute() { - ModifierDeck? deck = GameMethods.getModifierDeck(characterId, _gameState); + final ModifierDeck deck = GameMethods.getModifierDeck(characterId, _gameState); deck.addCSPartyCard(stateAccess, type); } diff --git a/server/lib/core/commands/add_faction_card_command.dart b/server/lib/core/commands/add_faction_card_command.dart index 00bbf0d..6848c9d 100644 --- a/server/lib/core/commands/add_faction_card_command.dart +++ b/server/lib/core/commands/add_faction_card_command.dart @@ -17,7 +17,7 @@ class AddFactionCardCommand extends Command { @override void execute() { - ModifierDeck? deck = GameMethods.getModifierDeck(characterId, _gameState); + final ModifierDeck deck = GameMethods.getModifierDeck(characterId, _gameState); if (add) { deck.addCard(stateAccess, cardId, CardType.add); } else { diff --git a/server/lib/core/commands/add_perk_command.dart b/server/lib/core/commands/add_perk_command.dart index c961e05..1b654b6 100644 --- a/server/lib/core/commands/add_perk_command.dart +++ b/server/lib/core/commands/add_perk_command.dart @@ -10,7 +10,7 @@ class AddPerkCommand extends Command { @override void execute() { - Character? character = GameMethods.getCharacterByName(characterId); + final Character? character = GameMethods.getCharacterByName(characterId); if (character != null) { character.flipPerk(stateAccess, index); } @@ -18,7 +18,7 @@ class AddPerkCommand extends Command { @override String describe() { - Character? character = GameMethods.getCharacterByName(characterId); + final Character? character = GameMethods.getCharacterByName(characterId); final charId = character?.id ?? characterId; if (character != null && !character.characterState.perkList[index]) { return commandL10n.cmdRemovePerk(charId, index); diff --git a/server/lib/core/commands/add_standee_command.dart b/server/lib/core/commands/add_standee_command.dart index ec10701..51c7ab5 100644 --- a/server/lib/core/commands/add_standee_command.dart +++ b/server/lib/core/commands/add_standee_command.dart @@ -37,7 +37,7 @@ class AddStandeeCommand extends Command { @override String describe() { final sum = summon; - String name = sum == null ? ownerId : sum.name; + final String name = sum == null ? ownerId : sum.name; return commandL10n.cmdAddStandee(name, nr); } diff --git a/server/lib/core/commands/amd_cassandra_special_command.dart b/server/lib/core/commands/amd_cassandra_special_command.dart index b1d1d5f..69bcea2 100644 --- a/server/lib/core/commands/amd_cassandra_special_command.dart +++ b/server/lib/core/commands/amd_cassandra_special_command.dart @@ -16,7 +16,7 @@ class AMDCassandraSpecialCommand extends Command { @override void execute() { - ModifierDeck deck = GameMethods.getModifierDeck(deckId, _gameState); + final ModifierDeck deck = GameMethods.getModifierDeck(deckId, _gameState); deck.setCassandraSpecial(stateAccess, on); } diff --git a/server/lib/core/commands/amd_imbue1_command.dart b/server/lib/core/commands/amd_imbue1_command.dart index 3cf52bc..d678979 100644 --- a/server/lib/core/commands/amd_imbue1_command.dart +++ b/server/lib/core/commands/amd_imbue1_command.dart @@ -8,7 +8,7 @@ class AMDImbue1Command extends Command { @override void execute() { - ModifierDeck deck = _gameState.modifierDeck; + final ModifierDeck deck = _gameState.modifierDeck; deck.setImbue1(stateAccess); } diff --git a/server/lib/core/commands/amd_imbue2_command.dart b/server/lib/core/commands/amd_imbue2_command.dart index 891d1f0..14e9bde 100644 --- a/server/lib/core/commands/amd_imbue2_command.dart +++ b/server/lib/core/commands/amd_imbue2_command.dart @@ -8,7 +8,7 @@ class AMDImbue2Command extends Command { @override void execute() { - ModifierDeck deck = _gameState.modifierDeck; + final ModifierDeck deck = _gameState.modifierDeck; deck.setImbue2(stateAccess); } diff --git a/server/lib/core/commands/amd_remove_imbue_command.dart b/server/lib/core/commands/amd_remove_imbue_command.dart index 0b37b5b..bb7219c 100644 --- a/server/lib/core/commands/amd_remove_imbue_command.dart +++ b/server/lib/core/commands/amd_remove_imbue_command.dart @@ -9,7 +9,7 @@ class AMDRemoveImbueCommand extends Command { @override void execute() { - ModifierDeck deck = _gameState.modifierDeck; + final ModifierDeck deck = _gameState.modifierDeck; deck.resetImbue(stateAccess); } diff --git a/server/lib/core/commands/amd_reveal_command.dart b/server/lib/core/commands/amd_reveal_command.dart index 1a0a1a3..a000b5c 100644 --- a/server/lib/core/commands/amd_reveal_command.dart +++ b/server/lib/core/commands/amd_reveal_command.dart @@ -16,7 +16,7 @@ class AMDRevealCommand extends Command { @override void execute() { - ModifierDeck deck = GameMethods.getModifierDeck(name, _gameState); + final ModifierDeck deck = GameMethods.getModifierDeck(name, _gameState); deck.revealCards(stateAccess, amount); } diff --git a/server/lib/core/commands/change_stat_commands/change_health_command.dart b/server/lib/core/commands/change_stat_commands/change_health_command.dart index 8d6b6f4..2ee11df 100644 --- a/server/lib/core/commands/change_stat_commands/change_health_command.dart +++ b/server/lib/core/commands/change_stat_commands/change_health_command.dart @@ -14,7 +14,7 @@ class ChangeHealthCommand extends ChangeStatCommand { @override void execute() { - FigureState? figure = GameMethods.getFigure(ownerId, figureId); + final FigureState? figure = GameMethods.getFigure(ownerId, figureId); if (figure != null) { final previousValue = figure.health; if (previousValue + change < 0) { @@ -44,7 +44,7 @@ class ChangeHealthCommand extends ChangeStatCommand { //TODO: looks bad return commandL10n.cmdIncreaseHealth(figureId, change); } - FigureState? figure = GameMethods.getFigure(ownerId, figureId); + final FigureState? figure = GameMethods.getFigure(ownerId, figureId); if (figure == null || figure.health <= 0) { return commandL10n.cmdKill(ownerId ?? ''); } diff --git a/server/lib/core/commands/change_stat_commands/change_max_health_command.dart b/server/lib/core/commands/change_stat_commands/change_max_health_command.dart index 70b26d9..38ad118 100644 --- a/server/lib/core/commands/change_stat_commands/change_max_health_command.dart +++ b/server/lib/core/commands/change_stat_commands/change_max_health_command.dart @@ -16,7 +16,7 @@ class ChangeMaxHealthCommand extends ChangeStatCommand { final FigureState? figure = GameMethods.getFigure(ownerId, figureId); if (figure == null) return; - int newValue = figure.maxHealth + change; + final int newValue = figure.maxHealth + change; if (newValue <= 0) { //can't lower maxvalue less than 1 return; diff --git a/server/lib/core/commands/donate_cs_sanctuary_command.dart b/server/lib/core/commands/donate_cs_sanctuary_command.dart index c1fdd0f..013850f 100644 --- a/server/lib/core/commands/donate_cs_sanctuary_command.dart +++ b/server/lib/core/commands/donate_cs_sanctuary_command.dart @@ -11,7 +11,7 @@ class DonateCSSanctuaryCommand extends Command { @override void execute() { - ModifierDeck? deck = GameMethods.getModifierDeck(characterId, _gameState); + final ModifierDeck deck = GameMethods.getModifierDeck(characterId, _gameState); deck.addCSSanctuary(stateAccess); } diff --git a/server/lib/core/commands/load_character_save_command.dart b/server/lib/core/commands/load_character_save_command.dart index 6014c47..6ca4d82 100644 --- a/server/lib/core/commands/load_character_save_command.dart +++ b/server/lib/core/commands/load_character_save_command.dart @@ -18,7 +18,7 @@ class LoadCharacterSaveCommand extends Command { @override void execute() { final data = json.decode(saveData) as Map<String, dynamic>; - Character character = Character.fromSave(data); + final Character character = Character.fromSave(data); //add new character on top of list, if not present. final Character? currentCharacter = GameMethods.getCharacterByName( diff --git a/server/lib/core/commands/next_round_command.dart b/server/lib/core/commands/next_round_command.dart index 22385fa..0c0c218 100644 --- a/server/lib/core/commands/next_round_command.dart +++ b/server/lib/core/commands/next_round_command.dart @@ -110,11 +110,11 @@ class NextRoundCommand extends Command { if (_settings.autoAddSpawns) { if (rule.name.isNotEmpty) { //get room data and deal with spawns - ScenarioModel? scenario = _gameData + final ScenarioModel? scenario = _gameData .modelData[_gameState.currentCampaign] ?.scenarios[_gameState.scenario]; if (scenario != null) { - ScenarioModel? spawnSection = scenario.sections.firstWhereOrNull( + final ScenarioModel? spawnSection = scenario.sections.firstWhereOrNull( (element) => element.name.substring(1) == rule.name, ); if (spawnSection != null) { diff --git a/server/lib/core/commands/remove_condition_command.dart b/server/lib/core/commands/remove_condition_command.dart index 04cdd40..c7bfa3e 100644 --- a/server/lib/core/commands/remove_condition_command.dart +++ b/server/lib/core/commands/remove_condition_command.dart @@ -18,9 +18,9 @@ class RemoveConditionCommand extends Command { @override void execute() { - FigureState? figure = GameMethods.getFigure(ownerId, figureId); + final FigureState? figure = GameMethods.getFigure(ownerId, figureId); if (figure != null) { - List<Condition> newList = []; + final List<Condition> newList = []; newList.addAll(figure.conditions); newList.remove(condition); figure.setConditions(stateAccess, newList); diff --git a/server/lib/core/commands/remove_cs_party_card_command.dart b/server/lib/core/commands/remove_cs_party_card_command.dart index 64f03bf..fa1a896 100644 --- a/server/lib/core/commands/remove_cs_party_card_command.dart +++ b/server/lib/core/commands/remove_cs_party_card_command.dart @@ -11,7 +11,7 @@ class RemoveCSPartyCardCommand extends Command { @override void execute() { - ModifierDeck? deck = GameMethods.getModifierDeck(characterId, _gameState); + final ModifierDeck deck = GameMethods.getModifierDeck(characterId, _gameState); deck.removeCSPartyCard(stateAccess); } diff --git a/server/lib/core/commands/remove_cs_sanctuary_donation_command.dart b/server/lib/core/commands/remove_cs_sanctuary_donation_command.dart index 3751097..4d9c246 100644 --- a/server/lib/core/commands/remove_cs_sanctuary_donation_command.dart +++ b/server/lib/core/commands/remove_cs_sanctuary_donation_command.dart @@ -13,7 +13,7 @@ class RemoveCSSanctuaryDonationCommand extends Command { @override void execute() { - ModifierDeck? deck = GameMethods.getModifierDeck(characterId, _gameState); + final ModifierDeck deck = GameMethods.getModifierDeck(characterId, _gameState); deck.removeCSSanctuary(stateAccess); } diff --git a/server/lib/core/commands/shuffle_drawn_ability_card_command.dart b/server/lib/core/commands/shuffle_drawn_ability_card_command.dart index 795b9b4..e9b6f8c 100644 --- a/server/lib/core/commands/shuffle_drawn_ability_card_command.dart +++ b/server/lib/core/commands/shuffle_drawn_ability_card_command.dart @@ -10,11 +10,11 @@ class ShuffleDrawnAbilityCardCommand extends Command { @override void execute() { - Monster? monster = GameMethods.getCurrentMonsters().firstWhereOrNull( + final Monster? monster = GameMethods.getCurrentMonsters().firstWhereOrNull( (element) => element.type.deck == deck, ); if (monster != null) { - MonsterAbilityState? deck = GameMethods.getDeck(monster.type.deck); + final MonsterAbilityState? deck = GameMethods.getDeck(monster.type.deck); deck?.shuffleUnDrawn(stateAccess); } } diff --git a/server/lib/core/commands/use_fh_perks_command.dart b/server/lib/core/commands/use_fh_perks_command.dart index 8200ae7..b857e45 100644 --- a/server/lib/core/commands/use_fh_perks_command.dart +++ b/server/lib/core/commands/use_fh_perks_command.dart @@ -9,7 +9,7 @@ class UseFHPerksCommand extends Command { @override void execute() { - Character? character = GameMethods.getCharacterByName(characterId); + final Character? character = GameMethods.getCharacterByName(characterId); if (character != null) { character.flipUseFHPerks(stateAccess); } @@ -17,7 +17,7 @@ class UseFHPerksCommand extends Command { @override String describe() { - Character? character = GameMethods.getCharacterByName(characterId); + final Character? character = GameMethods.getCharacterByName(characterId); final charId = character?.id ?? characterId; final use = character?.characterState.useFHPerks ?? false; if (use) { |
