summaryrefslogtreecommitdiff
path: root/server/lib/core/commands/remove_monster_command.dart
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/core/commands/remove_monster_command.dart')
-rw-r--r--server/lib/core/commands/remove_monster_command.dart24
1 files changed, 24 insertions, 0 deletions
diff --git a/server/lib/core/commands/remove_monster_command.dart b/server/lib/core/commands/remove_monster_command.dart
new file mode 100644
index 0000000..b64f1e6
--- /dev/null
+++ b/server/lib/core/commands/remove_monster_command.dart
@@ -0,0 +1,24 @@
+import '../state/game_state.dart';
+import 'command_l10n.dart';
+
+class RemoveMonsterCommand extends Command {
+ final List<Monster> names;
+
+ RemoveMonsterCommand(this.names, {required GameState gameState});
+
+ @override
+ void execute() {
+ MonsterMethods.removeMonsters(stateAccess, names);
+ }
+
+ @override
+ String describe() {
+ if (names.length > 1) {
+ return commandL10n.cmdRemoveAllMonsters;
+ }
+ if (names.isNotEmpty) {
+ return commandL10n.cmdRemoveMonster(names.first.type.display);
+ }
+ return commandL10n.cmdRemoveNoMonsters;
+ }
+}