summaryrefslogtreecommitdiff
path: root/server/lib/core/commands/amd_remove_plus_0_command.dart
blob: c6878e0bd09cfcf0723719ad71267430870a6b03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import '../game_methods.dart';
import '../state/game_state.dart';
import 'command_l10n.dart';

class AmdRemovePlus0Command extends Command {
  final String name;
  final bool remove;
  final GameState _gameState;

  AmdRemovePlus0Command(this.name, this.remove, {required GameState gameState})
    : _gameState = gameState;

  @override
  void execute() {
    final deck = GameMethods.getModifierDeck(name, _gameState);
    if (remove) {
      deck.moveCardToRemovedPile(stateAccess, "plus0");
    } else {
      deck.restoreCardFromRemovedPile(stateAccess, "plus0", CardType.add);
    }
  }

  @override
  String describe() {
    return remove
        ? commandL10n.cmdRemovePlusZero
        : commandL10n.cmdAddBackPlusZero;
  }
}