diff options
Diffstat (limited to 'server/lib/core/commands/set_scenario_command.dart')
| -rw-r--r-- | server/lib/core/commands/set_scenario_command.dart | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/server/lib/core/commands/set_scenario_command.dart b/server/lib/core/commands/set_scenario_command.dart new file mode 100644 index 0000000..56485eb --- /dev/null +++ b/server/lib/core/commands/set_scenario_command.dart @@ -0,0 +1,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; + } +} |
