Class: StatisticsTracker

StatisticsTracker()

new StatisticsTracker()

Source:

Members

Schema

Source:

UpdateSequenceInterval

This number specifies the time in milliseconds between consecutive statistics snapshots recorded.
Source:

[undefined][undefined]

Source:

[undefined][undefined]

Source:

buildingsCaptured

Source:

buildingsCapturedValue

Source:

buildingsCapturedValue

Source:

buildingsClasses

Source:

buildingsConstructed

Source:

buildingsLost

Source:

buildingsLostValue

Source:

buildingsLostValue

Source:

enemyBuildingsDestroyed

Source:

enemyBuildingsDestroyedValue

Source:

enemyBuildingsDestroyedValue

Source:

enemyUnitsKilled

Source:

enemyUnitsKilledValue

Source:

enemyUnitsKilledValue

Source:

failedBribes

Source:

lootCollected

Source:

lootCollected

Source:

peakPercentMapControlled

Source:

peakPercentMapControlled

Source:

resourcesBought

Source:

resourcesBought[undefined]

Source:

resourcesBought[undefined]

Source:

resourcesGathered

Source:

resourcesGathered[undefined]

Source:

resourcesGathered[undefined]

Source:

resourcesSold

Source:

resourcesSold[undefined]

Source:

resourcesSold[undefined]

Source:

resourcesUsed

Source:

resourcesUsed[undefined]

Source:

resourcesUsed[undefined]

Source:

sequences

Source:

successfulBribes

Source:

teamPeakPercentMapControlled

Source:

teamPeakPercentMapControlled

Source:

tradeIncome

Source:

tradeIncome

Source:

treasuresCollected

Source:

tributesReceived

Source:

tributesReceived

Source:

tributesSent

Source:

tributesSent

Source:

unitsCaptured

Source:

unitsCapturedValue

Source:

unitsCapturedValue

Source:

unitsClasses

Source:

unitsLost

Source:

unitsLostValue

Source:

unitsLostValue

Source:

unitsTrained

Source:

updateTimer

Source:

Methods

CapturedEntity()

Source:

CounterIncrement(classes, counter, type)

Increments counter associated with certain entity/counter and type of given entity.
Parameters:
Name Type Description
classes The classes an entity has.
counter the name of the counter to increment (e.g. "unitsTrained").
type the type of the counter (e.g. "workers").
Source:

GetBasicStatistics()

Returns a subset of statistics that will be added to the simulation state, thus called each turn. Basic statistics should not contain data that would be expensive to compute. Note: as of now, nothing in the game needs that, but some AIs developed by modders need it in the API.
Source:

GetPercentMapControlled()

Source:

GetPercentMapExplored()

Source:

GetPopulationCount()

Source:

GetResourceCounts() → {Object}

Source:
Returns:
- The amount of available resources.
Type
Object

GetSequences()

Source:

GetStatistics()

Source:

GetStatisticsJSON()

Used to print statistics for non-visual autostart games.
Source:
Returns:
The player's statistics as a JSON string beautified with some indentations.

GetTeamPercentMapControlled()

Source:

GetTeamPercentMapExplored()

Note: cmpRangeManager.GetUnionPercentMapExplored computes statistics from scratch! As a consequence, this function should not be called too often.
Source:

IncreaseConstructedBuildingsCounter()

Counts the total number of buildings constructed as well as an individual count for each building type. Based on templates.
Source:

IncreaseFailedBribesCounter()

Source:

IncreaseLootCollectedCounter()

Source:

IncreaseResourceGatheredCounter(type, amount, specificType)

Parameters:
Name Type Description
type string generic type of resource.
amount number amount of resource, whick should be added.
specificType string specific type of resource.
Source:

IncreaseResourceUsedCounter(type, amount)

Parameters:
Name Type Description
type string generic type of resource.
amount number amount of resource, which should be added.
Source:

IncreaseResourcesBoughtCounter()

Source:

IncreaseResourcesSoldCounter()

Source:

IncreaseSuccessfulBribesCounter()

Source:

IncreaseTradeIncomeCounter()

Source:

IncreaseTrainedUnitsCounter()

Counts the total number of units trained as well as an individual count for each unit type. Based on templates.
Source:

IncreaseTreasuresCollectedCounter()

Source:

IncreaseTributesReceivedCounter()

Source:

IncreaseTributesSentCounter()

Source:

Init()

Source:

KilledEntity()

Source:

LostEntity()

Source:

OnGlobalInitGame()

Source:

OnGlobalPlayerDefeated()

Source:

OnGlobalPlayerWon()

Source:

OnTerritoriesChanged()

Source:

PushValue(fromData, toData)

Adds the values of fromData to the end of the arrays of toData. If toData misses the needed array, one will be created.
Parameters:
Name Type Description
fromData an object of values or a value.
toData an object of arrays or an array.
Source:

UpdatePeakPercentages()

Source:

UpdateSequences()

Source: