#
Class: MapPlayer#
HierarchyHandle<player>
↳ MapPlayer
#
Properties#
handle• Readonly
handle: player
Defined in: handles/handle.ts:6
#
Accessors#
colorcolor(): playercolor
Returns: playercolor
Defined in: handles/player.ts:20
color(color: playercolor): void
#
Parameters:Name | Type |
---|---|
color | playercolor |
Returns: void
Defined in: handles/player.ts:16
#
controllercontroller(): mapcontrol
Returns: mapcontrol
Defined in: handles/player.ts:24
#
handicaphandicap(): number
Returns: number
Defined in: handles/player.ts:28
handicap(handicap: number): void
#
Parameters:Name | Type |
---|---|
handicap | number |
Returns: void
Defined in: handles/player.ts:32
#
handicapXphandicapXp(): number
Returns: number
Defined in: handles/player.ts:36
handicapXp(handicap: number): void
#
Parameters:Name | Type |
---|---|
handicap | number |
Returns: void
Defined in: handles/player.ts:40
#
idid(): number
Returns: number
Defined in: handles/player.ts:44
#
namename(): string
Returns: string
Defined in: handles/player.ts:48
name(value: string): void
#
Parameters:Name | Type |
---|---|
value | string |
Returns: void
Defined in: handles/player.ts:52
#
racerace(): race
Returns: race
Defined in: handles/player.ts:56
#
slotStateslotState(): playerslotstate
Returns: playerslotstate
Defined in: handles/player.ts:60
#
startLocationstartLocation(): number
Returns: number
Defined in: handles/player.ts:64
#
startLocationPointstartLocationPoint(): location
Returns: location
Defined in: handles/player.ts:76
#
startLocationXstartLocationX(): number
Returns: number
Defined in: handles/player.ts:68
#
startLocationYstartLocationY(): number
Returns: number
Defined in: handles/player.ts:72
#
teamteam(): number
Returns: number
Defined in: handles/player.ts:80
#
townHallCounttownHallCount(): number
Returns: number
Defined in: handles/player.ts:84
#
Methods#
addTechResearchedaddTechResearched(techId: number, levels: number): void
In upgrades that have multiple levels, it will research the upgrade by the number of levels specified.
#
Parameters:Name | Type | Description |
---|---|---|
techId | number | The four digit rawcode ID of the upgrade. |
levels | number | The number of levels to add to the current research level of the upgrade. |
Returns: void
Defined in: handles/player.ts:93
#
cacheHeroDatacacheHeroData(): void
Used to store hero level data for the scorescreen, before units are moved to neutral passive in melee games.
Returns: void
Defined in: handles/player.ts:104
#
compareAlliancecompareAlliance(otherPlayer: MapPlayer, whichAllianceSetting: alliancetype): boolean
#
Parameters:Name | Type |
---|---|
otherPlayer | MapPlayer |
whichAllianceSetting | alliancetype |
Returns: boolean
Defined in: handles/player.ts:108
#
coordsFoggedcoordsFogged(x: number, y: number): boolean
#
Parameters:Name | Type |
---|---|
x | number |
y | number |
Returns: boolean
Defined in: handles/player.ts:112
#
coordsMaskedcoordsMasked(x: number, y: number): boolean
#
Parameters:Name | Type |
---|---|
x | number |
y | number |
Returns: boolean
Defined in: handles/player.ts:116
#
coordsVisiblecoordsVisible(x: number, y: number): boolean
#
Parameters:Name | Type |
---|---|
x | number |
y | number |
Returns: boolean
Defined in: handles/player.ts:120
#
cripplecripple(toWhichPlayers: Force, flag: boolean): void
Reveals a player's remaining buildings to a force. The black mask over the buildings will be removed as if the territory had been discovered
note
his function will not check whether the player has a town hall before revealing.
#
Parameters:Name | Type | Description |
---|---|---|
toWhichPlayers | Force | The players who will see whichPlayer's buildings. |
flag | boolean | If true, the buildings will be revealed. If false, the buildings will not be revealed. Note that if you set it to false, it will not hide the buildings with a black mask. |
Returns: void
Defined in: handles/player.ts:132
#
decTechResearcheddecTechResearched(techId: number, levels: number): void
#
Parameters:Name | Type |
---|---|
techId | number |
levels | number |
Returns: void
Defined in: handles/player.ts:97
#
getScoregetScore(whichPlayerScore: playerscore): number
#
Parameters:Name | Type |
---|---|
whichPlayerScore | playerscore |
Returns: number
Defined in: handles/player.ts:136
#
getStategetState(whichPlayerState: playerstate): number
#
Parameters:Name | Type |
---|---|
whichPlayerState | playerstate |
Returns: number
Defined in: handles/player.ts:140
#
getStructureCountgetStructureCount(includeIncomplete: boolean): number
#
Parameters:Name | Type |
---|---|
includeIncomplete | boolean |
Returns: number
Defined in: handles/player.ts:144
#
getTaxRategetTaxRate(otherPlayer: player, whichResource: playerstate): number
#
Parameters:Name | Type |
---|---|
otherPlayer | player |
whichResource | playerstate |
Returns: number
Defined in: handles/player.ts:148
#
getTechCountgetTechCount(techId: number, specificonly: boolean): number
#
Parameters:Name | Type |
---|---|
techId | number |
specificonly | boolean |
Returns: number
Defined in: handles/player.ts:152
#
getTechMaxAllowedgetTechMaxAllowed(techId: number): number
#
Parameters:Name | Type |
---|---|
techId | number |
Returns: number
Defined in: handles/player.ts:156
#
getTechResearchedgetTechResearched(techId: number, specificonly: boolean): boolean
#
Parameters:Name | Type |
---|---|
techId | number |
specificonly | boolean |
Returns: boolean
Defined in: handles/player.ts:160
#
getUnitCountgetUnitCount(includeIncomplete: boolean): number
#
Parameters:Name | Type |
---|---|
includeIncomplete | boolean |
Returns: number
Defined in: handles/player.ts:164
#
getUnitCountByTypegetUnitCountByType(unitName: string, includeIncomplete: boolean, includeUpgrades: boolean): number
#
Parameters:Name | Type |
---|---|
unitName | string |
includeIncomplete | boolean |
includeUpgrades | boolean |
Returns: number
Defined in: handles/player.ts:168
#
inForceinForce(whichForce: Force): boolean
#
Parameters:Name | Type |
---|---|
whichForce | Force |
Returns: boolean
Defined in: handles/player.ts:172
#
isLocalisLocal(): boolean
Returns: boolean
Defined in: handles/player.ts:176
#
isObserverisObserver(): boolean
Returns: boolean
Defined in: handles/player.ts:180
#
isPlayerAllyisPlayerAlly(otherPlayer: MapPlayer): boolean
#
Parameters:Name | Type |
---|---|
otherPlayer | MapPlayer |
Returns: boolean
Defined in: handles/player.ts:184
#
isPlayerEnemyisPlayerEnemy(otherPlayer: MapPlayer): boolean
#
Parameters:Name | Type |
---|---|
otherPlayer | MapPlayer |
Returns: boolean
Defined in: handles/player.ts:188
#
isRacePrefSetisRacePrefSet(pref: racepreference): boolean
#
Parameters:Name | Type |
---|---|
pref | racepreference |
Returns: boolean
Defined in: handles/player.ts:192
#
isSelectableisSelectable(): boolean
Returns: boolean
Defined in: handles/player.ts:196
#
pointFoggedpointFogged(whichPoint: Point): boolean
#
Parameters:Name | Type |
---|---|
whichPoint | Point |
Returns: boolean
Defined in: handles/player.ts:200
#
pointMaskedpointMasked(whichPoint: Point): boolean
#
Parameters:Name | Type |
---|---|
whichPoint | Point |
Returns: boolean
Defined in: handles/player.ts:204
#
pointVisiblepointVisible(whichPoint: Point): boolean
#
Parameters:Name | Type |
---|---|
whichPoint | Point |
Returns: boolean
Defined in: handles/player.ts:208
#
removeremove(gameResult: playergameresult): void
#
Parameters:Name | Type |
---|---|
gameResult | playergameresult |
Returns: void
Defined in: handles/player.ts:212
#
removeAllGuardPositionsremoveAllGuardPositions(): void
Returns: void
Defined in: handles/player.ts:216
#
setAbilityAvailablesetAbilityAvailable(abilId: number, avail: boolean): void
#
Parameters:Name | Type |
---|---|
abilId | number |
avail | boolean |
Returns: void
Defined in: handles/player.ts:220
#
setAlliancesetAlliance(otherPlayer: MapPlayer, whichAllianceSetting: alliancetype, value: boolean): void
#
Parameters:Name | Type |
---|---|
otherPlayer | MapPlayer |
whichAllianceSetting | alliancetype |
value | boolean |
Returns: void
Defined in: handles/player.ts:224
#
setOnScoreScreensetOnScoreScreen(flag: boolean): void
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: void
Defined in: handles/player.ts:228
#
setStatesetState(whichPlayerState: playerstate, value: number): void
#
Parameters:Name | Type |
---|---|
whichPlayerState | playerstate |
value | number |
Returns: void
Defined in: handles/player.ts:232
#
setTaxRatesetTaxRate(otherPlayer: MapPlayer, whichResource: playerstate, rate: number): void
#
Parameters:Name | Type |
---|---|
otherPlayer | MapPlayer |
whichResource | playerstate |
rate | number |
Returns: void
Defined in: handles/player.ts:236
#
setTechMaxAllowedsetTechMaxAllowed(techId: number, maximum: number): void
#
Parameters:Name | Type |
---|---|
techId | number |
maximum | number |
Returns: void
Defined in: handles/player.ts:240
#
setTechResearchedsetTechResearched(techId: number, setToLevel: number): void
#
Parameters:Name | Type |
---|---|
techId | number |
setToLevel | number |
Returns: void
Defined in: handles/player.ts:244
#
setUnitsOwnersetUnitsOwner(newOwner: number): void
#
Parameters:Name | Type |
---|---|
newOwner | number |
Returns: void
Defined in: handles/player.ts:248
#
fromEnumstatic fromEnum(): MapPlayer
Returns: MapPlayer
Defined in: handles/player.ts:252
#
fromEventstatic fromEvent(): MapPlayer
Returns: MapPlayer
Defined in: handles/player.ts:256
#
fromFilterstatic fromFilter(): MapPlayer
Returns: MapPlayer
Defined in: handles/player.ts:260
#
fromHandlestatic fromHandle(handle: player): MapPlayer
#
Parameters:Name | Type |
---|---|
handle | player |
Returns: MapPlayer
Defined in: handles/player.ts:264
#
fromIndexstatic fromIndex(index: number): MapPlayer
#
Parameters:Name | Type |
---|---|
index | number |
Returns: MapPlayer
Defined in: handles/player.ts:268
#
fromLocalstatic fromLocal(): MapPlayer
async
Returns: MapPlayer
Defined in: handles/player.ts:275