Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/headquarters.js
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | PETRA.HQ.prototype.init = function(gameState, queues) | |||||||||||
// create borderMap: flag cells on the border of the map | // create borderMap: flag cells on the border of the map | |||||||||||
// then this map will be completed with our frontier in updateTerritories | // then this map will be completed with our frontier in updateTerritories | |||||||||||
this.borderMap = PETRA.createBorderMap(gameState); | this.borderMap = PETRA.createBorderMap(gameState); | |||||||||||
// list of allowed regions | // list of allowed regions | |||||||||||
this.landRegions = {}; | this.landRegions = {}; | |||||||||||
// try to determine if we have a water map | // try to determine if we have a water map | |||||||||||
this.navalMap = false; | this.navalMap = false; | |||||||||||
this.navalRegions = {}; | this.navalRegions = {}; | |||||||||||
this.treasures = gameState.getEntities().filter(ent => { | this.treasures = gameState.getEntities().filter(ent => ent.isTreasure()); | |||||||||||
StanUnsubmitted Done Inline Actions
Stan: | ||||||||||||
let type = ent.resourceSupplyType(); | ||||||||||||
return type && type.generic == "treasure"; | ||||||||||||
}); | ||||||||||||
this.treasures.registerUpdates(); | this.treasures.registerUpdates(); | |||||||||||
this.currentPhase = gameState.currentPhase(); | this.currentPhase = gameState.currentPhase(); | |||||||||||
this.decayingStructures = new Set(); | this.decayingStructures = new Set(); | |||||||||||
}; | }; | |||||||||||
/** | /** | |||||||||||
* initialization needed after deserialization (only called when deserialization) | * initialization needed after deserialization (only called when deserialization) | |||||||||||
*/ | */ | |||||||||||
▲ Show 20 Lines • Show All 2,818 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator