Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/ai/common-api/shared.js
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | m.SharedScript.prototype.init = function(state, deserialization) | ||||
this.ApplyTemplatesDelta(state); | this.ApplyTemplatesDelta(state); | ||||
this.passabilityClasses = state.passabilityClasses; | this.passabilityClasses = state.passabilityClasses; | ||||
this.playersData = state.players; | this.playersData = state.players; | ||||
this.timeElapsed = state.timeElapsed; | this.timeElapsed = state.timeElapsed; | ||||
this.circularMap = state.circularMap; | this.circularMap = state.circularMap; | ||||
this.mapSize = state.mapSize; | this.mapSize = state.mapSize; | ||||
this.victoryConditions = new Set([state.gameType]); | this.victoryConditions = new Set(state.victoryConditions); | ||||
this.alliedVictory = state.alliedVictory; | this.alliedVictory = state.alliedVictory; | ||||
this.ceasefireActive = state.ceasefireActive; | this.ceasefireActive = state.ceasefireActive; | ||||
this.ceasefireTimeRemaining = state.ceasefireTimeRemaining / 1000; | this.ceasefireTimeRemaining = state.ceasefireTimeRemaining / 1000; | ||||
this.passabilityMap = state.passabilityMap; | this.passabilityMap = state.passabilityMap; | ||||
if (this.mapSize % this.passabilityMap.width !== 0) | if (this.mapSize % this.passabilityMap.width !== 0) | ||||
error("AI shared component inconsistent sizes: map=" + this.mapSize + " while passability=" + this.passabilityMap.width); | error("AI shared component inconsistent sizes: map=" + this.mapSize + " while passability=" + this.passabilityMap.width); | ||||
this.passabilityMap.cellSize = this.mapSize / this.passabilityMap.width; | this.passabilityMap.cellSize = this.mapSize / this.passabilityMap.width; | ||||
▲ Show 20 Lines • Show All 310 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator