Class: Player

Player()

new Player()

Source:

Methods

AddResource(type, amount)

Add resource of specified type to player.
Parameters:
Name Type Description
type string Generic type of resource.
amount number Amount of resource, which should be added.
Source:

AddResourceGatherer(type)

Parameters:
Name Type Description
type string The generic type of resource to add the gatherer for.
Source:

AddResources()

Add resources to player.
Source:

IsAlly()

Check if given player is our ally.
Source:

IsEnemy()

Check if given player is our enemy
Source:

IsExclusiveAlly()

Check if given player is our ally excluding ourself
Source:

IsExclusiveMutualAlly()

Check if given player is our ally, and we are its ally, excluding ourself
Source:

IsMutualAlly()

Check if given player is our ally, and we are its ally
Source:

IsNeutral()

Check if given player is neutral
Source:

OnGlobalInitGame()

Do some map dependant initializations
Source:

OnGlobalOwnershipChanged()

Keep track of population effects of all entities that become owned or unowned by this player.
Source:

RemoveResourceGatherer(type)

Parameters:
Name Type Description
type string The generic type of resource to remove the gatherer from.
Source:

Serialize()

Don't serialize diplomacyColor or displayDiplomacyColor since they're modified by the GUI.
Source:

SetState(newState, message)

Parameters:
Name Type Description
newState string Either "defeated" or "won".
message string | undefined A string to be shown in chat, for example markForTranslation("%(player)s has been defeated (failed objective)."). If it is undefined, the caller MUST send that GUI notification manually.
Source: