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

class SetAutoLevelAdjustCommand extends Command {
  SetAutoLevelAdjustCommand(this.on, {required GameState gameState})
    : _gameState = gameState;

  bool on;
  final GameState _gameState;

  @override
  void execute() {
    _gameState.setAutoScenarioLevel(stateAccess, on);
    ScenarioMethods.applyDifficulty(stateAccess);
  }

  @override
  String describe() {
    return on ? commandL10n.cmdAutoLevelOn : commandL10n.cmdAutoLevelOff;
  }
}