summaryrefslogtreecommitdiff
path: root/server/lib/core/commands/use_element_command.dart
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/core/commands/use_element_command.dart')
-rw-r--r--server/lib/core/commands/use_element_command.dart21
1 files changed, 21 insertions, 0 deletions
diff --git a/server/lib/core/commands/use_element_command.dart b/server/lib/core/commands/use_element_command.dart
new file mode 100644
index 0000000..5183106
--- /dev/null
+++ b/server/lib/core/commands/use_element_command.dart
@@ -0,0 +1,21 @@
+import '../enums.dart';
+import '../state/game_state.dart';
+import 'command_l10n.dart';
+
+class UseElementCommand extends Command {
+ final Elements element;
+ final GameState? _gameState;
+
+ UseElementCommand(this.element, {GameState? gameState})
+ : _gameState = gameState;
+
+ @override
+ void execute() {
+ ElementMethods.useElement(stateAccess, element, gameState: _gameState);
+ }
+
+ @override
+ String describe() {
+ return commandL10n.cmdUseElement(element.name);
+ }
+}