summaryrefslogtreecommitdiff
path: root/server/lib/core/commands/amd_cassandra_special_command.dart
blob: 69bcea2e21bc5f9c7c1ebd7a3a61f682a78d906d (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
30
import 'package:x_haven_server/core/game_methods.dart';

import '../state/game_state.dart';
import 'command_l10n.dart';

class AMDCassandraSpecialCommand extends Command {
  String deckId;
  bool on;
  final GameState _gameState;

  AMDCassandraSpecialCommand(
    this.deckId,
    this.on, {
    required GameState gameState,
  }) : _gameState = gameState;

  @override
  void execute() {
    final ModifierDeck deck = GameMethods.getModifierDeck(deckId, _gameState);
    deck.setCassandraSpecial(stateAccess, on);
  }

  @override
  String describe() {
    if (on) {
      return commandL10n.cmdCassandraLeaveRevealed(deckId);
    }
    return commandL10n.cmdCassandraSpecialOff(deckId);
  }
}