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

class RemoveMonsterCommand extends Command {
  final List<Monster> names;

  RemoveMonsterCommand(this.names, {required GameState gameState});

  @override
  void execute() {
    MonsterMethods.removeMonsters(stateAccess, names);
  }

  @override
  String describe() {
    if (names.length > 1) {
      return commandL10n.cmdRemoveAllMonsters;
    }
    if (names.isNotEmpty) {
      return commandL10n.cmdRemoveMonster(names.first.type.display);
    }
    return commandL10n.cmdRemoveNoMonsters;
  }
}