mirror of
https://github.com/yairm210/Unciv.git
synced 2024-12-22 23:34:24 +07:00
Resolved #12461 - added 'unit remove all' console command
This commit is contained in:
parent
8ab193b125
commit
e8e87edb29
@ -19,9 +19,15 @@ internal class ConsoleUnitCommands : ConsoleCommandNode {
|
||||
DevConsoleResponse.OK
|
||||
},
|
||||
|
||||
"remove" to ConsoleAction("unit remove") { console, _ ->
|
||||
val unit = console.getSelectedUnit()
|
||||
unit.destroy()
|
||||
"remove" to ConsoleAction("unit remove [all]") { console, params ->
|
||||
if (params.isNotEmpty() && params[0].equals("all")) {
|
||||
for (civ in console.gameInfo.civilizations)
|
||||
for (unit in civ.units.getCivUnits())
|
||||
unit.destroy()
|
||||
} else {
|
||||
val unit = console.getSelectedUnit()
|
||||
unit.destroy()
|
||||
}
|
||||
DevConsoleResponse.OK
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user