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