Class: Force#

Hierarchy#

Constructors#

constructor#

new Force(): Force

Returns: Force

Defined in: handles/force.ts:6

Properties#

handle#

• Readonly handle: force

Inherited from: Handle.handle

Defined in: handles/handle.ts:6

Accessors#

id#

id(): number

Get the unique ID of the handle. The ID is recycled once you destroy the object.

Returns: number

The unique ID of a handle object.

Defined in: handles/handle.ts:18

Methods#

addPlayer#

addPlayer(whichPlayer: MapPlayer): void

Parameters:#

NameType
whichPlayerMapPlayer

Returns: void

Defined in: handles/force.ts:16


clear#

clear(): void

Returns: void

Defined in: handles/force.ts:20


destroy#

destroy(): void

Returns: void

Defined in: handles/force.ts:24


enumAllies#

enumAllies(whichPlayer: MapPlayer, filter: boolexpr | function): void

Parameters:#

NameType
whichPlayerMapPlayer
filterboolexpr | () => boolean

Returns: void

Defined in: handles/force.ts:28


enumEnemies#

enumEnemies(whichPlayer: MapPlayer, filter: boolexpr | function): void

Parameters:#

NameType
whichPlayerMapPlayer
filterboolexpr | () => boolean

Returns: void

Defined in: handles/force.ts:32


enumPlayers#

enumPlayers(filter: boolexpr | function): void

Parameters:#

NameType
filterboolexpr | () => boolean

Returns: void

Defined in: handles/force.ts:36


enumPlayersCounted#

enumPlayersCounted(filter: boolexpr | function, countLimit: number): void

Parameters:#

NameType
filterboolexpr | () => boolean
countLimitnumber

Returns: void

Defined in: handles/force.ts:40


for#

for(callback: function): void

Parameters:#

NameType
callback() => void

Returns: void

Defined in: handles/force.ts:44


getPlayers#

getPlayers(): MapPlayer[]

Returns all player handles belonging to this force

Returns: MapPlayer[]

Defined in: handles/force.ts:51


hasPlayer#

hasPlayer(whichPlayer: MapPlayer): boolean

Parameters:#

NameType
whichPlayerMapPlayer

Returns: boolean

Defined in: handles/force.ts:59


removePlayer#

removePlayer(whichPlayer: MapPlayer): void

Parameters:#

NameType
whichPlayerMapPlayer

Returns: void

Defined in: handles/force.ts:63


fromHandle#

static fromHandle(handle: force): Force

Parameters:#

NameType
handleforce

Returns: Force

Defined in: handles/force.ts:67