Class: Diplomacy

Diplomacy()

new Diplomacy()

Source:

Members

Schema

Source:

SerializableAttributes

Source:

[undefined]

Source:

diplomacy

Source:

diplomacy

Source:

diplomacyColor

Source:

diplomacy[undefined]

Source:

sharedDropsites

Source:

team

Source:

team

Source:

teamLocked

Source:

Methods

Ally(id)

Parameters:
Name Type Description
id number id
Source:

ChangeTeam(team)

Parameters:
Name Type Description
team number The new team number, -1 for no team.
Source:

Deserialize()

Source:

GetAllies() → {Array.<number>}

Source:
Returns:
-
Type
Array.<number>

GetColor() → {Object}

Source:
Returns:
-
Type
Object

GetDiplomacy() → {Array.<number>}

Source:
Returns:
- Current diplomatic stances.
Type
Array.<number>

GetEnemies() → {Array.<number>}

Source:
Returns:
-
Type
Array.<number>

GetMutualAllies() → {Array.<number>}

Source:
Returns:
-
Type
Array.<number>

GetPlayersByDiplomacy(func) → {Array.<number>}

Helper function for getting allies etc.
Parameters:
Name Type Description
func string Name of the function to test.
Source:
Returns:
- Player IDs matching the function.
Type
Array.<number>

GetTeam() → {number}

Source:
Returns:
-
Type
number

HasSharedDropsites() → {boolean}

Source:
Returns:
-
Type
boolean

HasSharedLos() → {boolean}

Source:
Returns:
-
Type
boolean

Init()

Source:

IsAlly(id) → {boolean}

Check if given player is our ally.
Parameters:
Name Type Description
id number -
Source:
Returns:
-
Type
boolean

IsEnemy(id) → {boolean}

Check if given player is our enemy.
Parameters:
Name Type Description
id number -
Source:
Returns:
-
Type
boolean

IsExclusiveAlly(id) → {boolean}

Check if given player is our ally excluding ourself.
Parameters:
Name Type Description
id number -
Source:
Returns:
-
Type
boolean

IsExclusiveMutualAlly(id) → {boolean}

Check if given player is our ally, and we are its ally, excluding ourself.
Parameters:
Name Type Description
id number -
Source:
Returns:
-
Type
boolean

IsMutualAlly(id) → {boolean}

Check if given player is our ally, and we are its ally.
Parameters:
Name Type Description
id number -
Source:
Returns:
-
Type
boolean

IsNeutral(id) → {boolean}

Check if given player is neutral.
Parameters:
Name Type Description
id number -
Source:
Returns:
-
Type
boolean

IsTeamLocked() → {boolean}

Source:
Returns:
-
Type
boolean

LockTeam()

Source:

OnDiplomacyChanged()

Source:

OnResearchFinished()

Source:

Serialize()

Source:

SetDiplomacy(dipl)

Parameters:
Name Type Description
dipl Array.<number> The diplomacy array to set.
Source:

SetDiplomacyColor(color)

Parameters:
Name Type Description
color Object r, g, b values of the diplomacy colour.
Source:

SetDiplomacyIndex(idx, value)

Helper function for allying etc.
Parameters:
Name Type Description
idx number The player number.
value number The diplomacy value.
Source:

SetEnemy(id)

Parameters:
Name Type Description
id number -
Source:

SetNeutral(id)

Parameters:
Name Type Description
id number -
Source:

UnLockTeam()

Source:

UpdateSharedLos()

Source: