Unit.UnitView

public static class UnitView implements Serializable

Constructors

UnitView

public UnitView(Unit unit)

Methods

getCargoAmount

public int getCargoAmount()

Get the amount of gold or wood being carried by this unit.

getCargoType

public ResourceType getCargoType()

Get the type of resource being carried by the unit. This is only relevant if getCargoAmount() indicates an amount being carried.

getCurrentDurativeAction

public Action getCurrentDurativeAction()

Get the template id of the unit or upgrade currently being produced. This is only relevant if getCurrentProductionAmount indicates something has progress

Returns:The id of the template of what is being produced, or null

getCurrentDurativeProgress

public int getCurrentDurativeProgress()

Get the progress of this unit toward executing a durative action.

getHP

public int getHP()

Get the current health of the unit

getID

public int getID()

Get the unique identification number of this unit

getTemplateView

public UnitTemplateView getTemplateView()

Get a view of the template this unit was made from. This carries information shared by all units of that type, such as the name, attack, armor, basic health, cost, prerequisites for building it, and what units/upgrades it can produce

getXPosition

public int getXPosition()

Get the x coordinate of the unit

getYPosition

public int getYPosition()

Get the y coordinate of the unit