summaryrefslogtreecommitdiff
path: root/server/lib/core/commands/set_level_command.dart
blob: 84efcd2cb8da1c4dabc2b454af4c3bc8b3f78cbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import '../state/game_state.dart';
import 'command_l10n.dart';

class SetLevelCommand extends Command {
  final int level;
  final String? monsterId;

  SetLevelCommand(this.level, this.monsterId);

  @override
  void execute() {
    ScenarioMethods.setLevel(stateAccess, level, monsterId);
  }

  @override
  String describe() {
    if (monsterId != null) {
      return commandL10n.cmdSetMonsterLevel(monsterId!);
    }
    return commandL10n.cmdSetLevel;
  }
}