Class: DefenseArmy

DefenseArmy()

new DefenseArmy()

Source:

Classes

DefenseArmy

Members

Config

Source:

ID

Source:

[undefined]

Source:

assignedAgainst

Source:

assignedAgainst

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined][undefined]

Source:

assignedTo

Source:

assignedTo

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

breakawaySize

Source:

compactSize

Source:

foeEntities

Source:

foeEntities[undefined]

Source:

foeInfo

Source:

foeInfo

Source:

foeInfo

Source:

foeInfo

Source:

foeInfo

Source:

foeInfo

Source:

foePosition

Source:

foePosition[0]

Source:

foePosition[1]

Source:

foeStrength

Source:

foeStrength

Source:

foeStrength

Source:

ownEntities

Source:

ownEntities[undefined]

Source:

ownStrength

Source:

ownStrength

Source:

ownStrength

Source:

positionLastUpdate

Source:

positionLastUpdate

Source:

positionLastUpdate

Source:

positionLastUpdate

Source:

type

Source:

Methods

Deserialize()

Source:

Serialize()

Source:

addFoe()

add an entity to the enemy army Will return true if the entity was added and false otherwise. won't recalculate our position but will dirty it. force is true at army creation or when merging armies, so in this case we should add it even if far
Source:

addOwn()

adds a defender but doesn't assign him yet. force is true when merging armies, so in this case we should add it even if no position as it can be in a ship
Source:

assignUnit()

Source:

checkEvents()

Source:

clear()

resets the army properly. assumes we already cleared dead units.
Source:

evaluateStrength()

adds or remove the strength of the entity either to the enemy or to our units.
Source:

getState()

Source:

getType()

Source:

merge()

merge this army with another properly. assumes units are in only one army. also assumes that all have been properly cleaned up (no dead units).
Source:

needsDefenders()

Source:

recalculatePosition()

if not forced, will only recalculate if on a different turn.
Source:

recalculateStrengths()

Source:

removeFoe()

returns true if the entity was removed and false otherwise. TODO: when there is a technology update, we should probably recompute the strengths, or weird stuffs will happen.
Source:

removeOwn()

Source:

update()

Source:

DefenseArmy()

Armies used by the defense manager. An army is a collection of own entities and enemy entities. Types of armies: "default": army to counter an invading army "capturing": army set to capture a gaia building or recover capture points to one of its own structures It must contain only one foe (the building to capture) and never be merged

Constructor

new DefenseArmy()

Source:

Classes

DefenseArmy

Members

Config

Source:

ID

Source:

[undefined]

Source:

assignedAgainst

Source:

assignedAgainst

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined]

Source:

assignedAgainst[undefined][undefined]

Source:

assignedTo

Source:

assignedTo

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

assignedTo[undefined]

Source:

breakawaySize

Source:

compactSize

Source:

foeEntities

Source:

foeEntities[undefined]

Source:

foeInfo

Source:

foeInfo

Source:

foeInfo

Source:

foeInfo

Source:

foeInfo

Source:

foeInfo

Source:

foePosition

Source:

foePosition[0]

Source:

foePosition[1]

Source:

foeStrength

Source:

foeStrength

Source:

foeStrength

Source:

ownEntities

Source:

ownEntities[undefined]

Source:

ownStrength

Source:

ownStrength

Source:

ownStrength

Source:

positionLastUpdate

Source:

positionLastUpdate

Source:

positionLastUpdate

Source:

positionLastUpdate

Source:

type

Source:

Methods

Deserialize()

Source:

Serialize()

Source:

addFoe()

add an entity to the enemy army Will return true if the entity was added and false otherwise. won't recalculate our position but will dirty it. force is true at army creation or when merging armies, so in this case we should add it even if far
Source:

addOwn()

adds a defender but doesn't assign him yet. force is true when merging armies, so in this case we should add it even if no position as it can be in a ship
Source:

assignUnit()

Source:

checkEvents()

Source:

clear()

resets the army properly. assumes we already cleared dead units.
Source:

evaluateStrength()

adds or remove the strength of the entity either to the enemy or to our units.
Source:

getState()

Source:

getType()

Source:

merge()

merge this army with another properly. assumes units are in only one army. also assumes that all have been properly cleaned up (no dead units).
Source:

needsDefenders()

Source:

recalculatePosition()

if not forced, will only recalculate if on a different turn.
Source:

recalculateStrengths()

Source:

removeFoe()

returns true if the entity was removed and false otherwise. TODO: when there is a technology update, we should probably recompute the strengths, or weird stuffs will happen.
Source:

removeOwn()

Source:

update()

Source: