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

class EnhanceLootCardCommand extends Command {
  EnhanceLootCardCommand(
    this.id,
    this.value,
    this.resourceType, {
    required GameState gameState,
  }) : _gameState = gameState;
  final int value;
  final int id;
  final String resourceType;
  final GameState _gameState;

  @override
  void execute() {
    _gameState.lootDeck.addEnhancement(stateAccess, id, value);
  }

  @override
  String describe() {
    if (value <= 0) {
      return commandL10n.cmdRemoveLootEnhancement;
    }
    return commandL10n.cmdAddLootEnhancement;
  }
}