Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/headquarters.js
Show First 20 Lines • Show All 2,636 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
/** | /** | ||||
* Some functions are run every turn | * Some functions are run every turn | ||||
* Others once in a while | * Others once in a while | ||||
*/ | */ | ||||
m.HQ.prototype.update = function(gameState, queues, events) | m.HQ.prototype.update = function(gameState, queues, events) | ||||
{ | { | ||||
m.chatTest(gameState, 1); | |||||
Engine.ProfileStart("Headquarters update"); | Engine.ProfileStart("Headquarters update"); | ||||
this.turnCache = {}; | this.turnCache = {}; | ||||
this.territoryMap = m.createTerritoryMap(gameState); | this.territoryMap = m.createTerritoryMap(gameState); | ||||
this.canBarter = gameState.getOwnEntitiesByClass("BarterMarket", true).filter(API3.Filters.isBuilt()).hasEntities(); | this.canBarter = gameState.getOwnEntitiesByClass("BarterMarket", true).filter(API3.Filters.isBuilt()).hasEntities(); | ||||
// TODO find a better way to update | // TODO find a better way to update | ||||
if (this.currentPhase != gameState.currentPhase()) | if (this.currentPhase != gameState.currentPhase()) | ||||
{ | { | ||||
if (this.Config.debug > 0) | if (this.Config.debug > 0) | ||||
▲ Show 20 Lines • Show All 223 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator