Class: Unit
Represents a Player's Unit.
Hierarchy
Constructors
constructor
• new Unit(data
, unit
)
Parameters
Name | Type |
---|---|
data | APIPlayer |
unit | APIPlayerItem |
Defined in
Properties
name
• name: string
The name of this unit.
Defined in
level
• level: number
The level of this unit.
Defined in
maxLevel
• maxLevel: number
The max level of this unit.
Defined in
village
• village: "home"
| "builderBase"
The village type of this unit.
Defined in
isLoaded
• isLoaded: boolean
Whether the Game data has been loaded for this unit.
Defined in
id
• id: number
Id of this unit.
Defined in
housingSpace
• housingSpace: number
Housing space of this unit.
Defined in
hallMaxLevel
• hallMaxLevel: number
Town/Builder hall's max level of this unit.
Defined in
unlockHallLevel
• unlockHallLevel: number
Unlock Town/Builder Hall level of this unit.
Defined in
unlockCost
• unlockCost: number
Unlock cost of this unit.
Defined in
unlockTime
• unlockTime: number
Unlock time of this unit.
Defined in
unlockResource
• unlockResource: string
Unlock resource of this unit.
Defined in
unlockBuilding
• unlockBuilding: string
Unlock building of this unit.
Defined in
unlockBuildingLevel
• unlockBuildingLevel: number
Unlock building level of this unit.
Defined in
upgradeCost
• upgradeCost: number
Upgrade cost of this unit.
Defined in
upgradeResource
• upgradeResource: string
Upgrade resource of this unit.
Defined in
upgradeTime
• upgradeTime: number
Upgrade time of this unit.
Defined in
seasonal
• seasonal: boolean
Whether the unit is seasonal.
Defined in
dps
• dps: number
Damage per second of this unit.
Defined in
trainingTime
• trainingTime: number
Training time of this unit.
Defined in
Accessors
isHomeBase
• get
isHomeBase(): boolean
Whether the unit belongs to the home base.
Returns
boolean
Defined in
isBuilderBase
• get
isBuilderBase(): boolean
Whether the unit belongs to the builder base.
Returns
boolean
Defined in
isMax
• get
isMax(): boolean
Whether the unit is at max level.
Returns
boolean