Skip to main content

Class: Unit

Represents a Player's Unit.

Hierarchy​

Constructors​

constructor​

• new Unit(data, unit)

Parameters​

NameType
dataAPIPlayer
unitAPIPlayerItem

Defined in​

struct/Unit.ts:81

Properties​

name​

• name: string

The name of this unit.

Defined in​

struct/Unit.ts:7


level​

• level: number

The level of this unit.

Defined in​

struct/Unit.ts:10


maxLevel​

• maxLevel: number

The max level of this unit.

Defined in​

struct/Unit.ts:13


village​

• village: "home" | "builderBase"

The village type of this unit.

Defined in​

struct/Unit.ts:16


isLoaded​

• isLoaded: boolean

Whether the Game data has been loaded for this unit.

Defined in​

struct/Unit.ts:21


id​

• id: number

Id of this unit.

Defined in​

struct/Unit.ts:24


housingSpace​

• housingSpace: number

Housing space of this unit.

Defined in​

struct/Unit.ts:27


hallMaxLevel​

• hallMaxLevel: number

Town/Builder hall's max level of this unit.

Defined in​

struct/Unit.ts:30


unlockHallLevel​

• unlockHallLevel: number

Unlock Town/Builder Hall level of this unit.

Defined in​

struct/Unit.ts:33


unlockCost​

• unlockCost: number

Unlock cost of this unit.

Defined in​

struct/Unit.ts:36


unlockTime​

• unlockTime: number

Unlock time of this unit.

Defined in​

struct/Unit.ts:39


unlockResource​

• unlockResource: string

Unlock resource of this unit.

Defined in​

struct/Unit.ts:42


unlockBuilding​

• unlockBuilding: string

Unlock building of this unit.

Defined in​

struct/Unit.ts:45


unlockBuildingLevel​

• unlockBuildingLevel: number

Unlock building level of this unit.

Defined in​

struct/Unit.ts:48


upgradeCost​

• upgradeCost: number

Upgrade cost of this unit.

Defined in​

struct/Unit.ts:51


upgradeResource​

• upgradeResource: string

Upgrade resource of this unit.

Defined in​

struct/Unit.ts:54


upgradeTime​

• upgradeTime: number

Upgrade time of this unit.

Defined in​

struct/Unit.ts:57


seasonal​

• seasonal: boolean

Whether the unit is seasonal.

Defined in​

struct/Unit.ts:60


dps​

• dps: number

Damage per second of this unit.

Defined in​

struct/Unit.ts:63


trainingTime​

• trainingTime: number

Training time of this unit.

Defined in​

struct/Unit.ts:66

Accessors​

isHomeBase​

• get isHomeBase(): boolean

Whether the unit belongs to the home base.

Returns​

boolean

Defined in​

struct/Unit.ts:147


isBuilderBase​

• get isBuilderBase(): boolean

Whether the unit belongs to the builder base.

Returns​

boolean

Defined in​

struct/Unit.ts:152


isMax​

• get isMax(): boolean

Whether the unit is at max level.

Returns​

boolean

Defined in​

struct/Unit.ts:157