mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 05:41:11 +07:00
Better order of unit actions
This commit is contained in:
@ -41,23 +41,6 @@ object UnitActions {
|
|||||||
val tile = unit.getTile()
|
val tile = unit.getTile()
|
||||||
val actionList = ArrayList<UnitAction>()
|
val actionList = ArrayList<UnitAction>()
|
||||||
|
|
||||||
if (unit.isMoving())
|
|
||||||
actionList += UnitAction(UnitActionType.StopMovement) { unit.action = null }
|
|
||||||
if (unit.isExploring())
|
|
||||||
actionList += UnitAction(UnitActionType.StopExploration) { unit.action = null }
|
|
||||||
if (unit.isAutomated())
|
|
||||||
actionList += UnitAction(UnitActionType.StopAutomation) { unit.action = null }
|
|
||||||
|
|
||||||
addSleepActions(actionList, unit, false)
|
|
||||||
addFortifyActions(actionList, unit, false)
|
|
||||||
|
|
||||||
addPromoteAction(unit, actionList)
|
|
||||||
UnitActionsUpgrade.addUnitUpgradeAction(unit, actionList)
|
|
||||||
UnitActionsPillage.addPillageAction(unit, actionList)
|
|
||||||
addExplorationActions(unit, actionList)
|
|
||||||
addWaitAction(unit, actionList)
|
|
||||||
addToggleActionsAction(unit, actionList)
|
|
||||||
|
|
||||||
// Determined by unit uniques
|
// Determined by unit uniques
|
||||||
addTransformAction(unit, actionList)
|
addTransformAction(unit, actionList)
|
||||||
addParadropAction(unit, actionList)
|
addParadropAction(unit, actionList)
|
||||||
@ -76,6 +59,26 @@ object UnitActions {
|
|||||||
addTriggerUniqueActions(unit, actionList)
|
addTriggerUniqueActions(unit, actionList)
|
||||||
addAddInCapitalAction(unit, actionList, tile)
|
addAddInCapitalAction(unit, actionList, tile)
|
||||||
|
|
||||||
|
if (unit.isMoving())
|
||||||
|
actionList += UnitAction(UnitActionType.StopMovement) { unit.action = null }
|
||||||
|
if (unit.isExploring())
|
||||||
|
actionList += UnitAction(UnitActionType.StopExploration) { unit.action = null }
|
||||||
|
if (unit.isAutomated())
|
||||||
|
actionList += UnitAction(UnitActionType.StopAutomation) { unit.action = null }
|
||||||
|
|
||||||
|
addPromoteAction(unit, actionList)
|
||||||
|
UnitActionsUpgrade.addUnitUpgradeAction(unit, actionList)
|
||||||
|
UnitActionsPillage.addPillageAction(unit, actionList)
|
||||||
|
addSleepActions(actionList, unit, false)
|
||||||
|
addFortifyActions(actionList, unit, false)
|
||||||
|
|
||||||
|
|
||||||
|
if (unit.isMilitary()) addExplorationActions(unit, actionList)
|
||||||
|
|
||||||
|
addWaitAction(unit, actionList)
|
||||||
|
|
||||||
|
addToggleActionsAction(unit, actionList)
|
||||||
|
|
||||||
return actionList
|
return actionList
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,6 +92,7 @@ object UnitActions {
|
|||||||
addSwapAction(unit, actionList)
|
addSwapAction(unit, actionList)
|
||||||
addDisbandAction(actionList, unit)
|
addDisbandAction(actionList, unit)
|
||||||
addGiftAction(unit, actionList, tile)
|
addGiftAction(unit, actionList, tile)
|
||||||
|
if (unit.isCivilian()) addExplorationActions(unit, actionList)
|
||||||
|
|
||||||
|
|
||||||
addToggleActionsAction(unit, actionList)
|
addToggleActionsAction(unit, actionList)
|
||||||
|
Reference in New Issue
Block a user