summaryrefslogtreecommitdiff
path: root/server/lib/core/commands/draw_loot_card_command.dart
blob: be2187ff670541513c9ff04da1f1363199f41e82 (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
import '../game_event.dart';
import '../state/game_state.dart';
import 'command_l10n.dart';

class DrawLootCardCommand extends Command {
  final GameState _gameState;

  DrawLootCardCommand({required GameState gameState}) : _gameState = gameState;

  @override
  void execute() {
    if (_gameState.lootDeck.drawPileIsNotEmpty) {
      _gameState.lootDeck.draw(stateAccess);
    }
  }

  @override
  String describe() {
    return commandL10n.cmdDrawLootCard;
  }

  @override
  GameEvent get event => const LootCardDrawnEvent();
}