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

class SetScenarioCommand extends Command {
  final String _scenario;
  final bool _section;

  SetScenarioCommand(
    this._scenario,
    this._section, {
    required GameState gameState,
  });

  @override
  void execute() {
    ScenarioMethods.setScenario(stateAccess, _scenario, _section);
  }

  @override
  String describe() {
    if (!_section) {
      return commandL10n.cmdSetScenario;
    }
    return commandL10n.cmdAddSection;
  }
}