Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/AIProxy.js
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
AIProxy.prototype.OnHealthChanged = function(msg) | AIProxy.prototype.OnHealthChanged = function(msg) | ||||
{ | { | ||||
if (!this.NotifyChange()) | if (!this.NotifyChange()) | ||||
return; | return; | ||||
this.changes.hitpoints = msg.to; | this.changes.hitpoints = msg.to; | ||||
}; | }; | ||||
AIProxy.prototype.OnGarrisonedStateChanged = function(msg) | |||||
{ | |||||
if (!this.NotifyChange()) | |||||
return; | |||||
if (msg.holder == INVALID_ENTITY) | |||||
this.changes.garrisonHolder = undefined; | |||||
else | |||||
this.changes.garrisonHolder = msg.holder; | |||||
}; | |||||
AIProxy.prototype.OnCapturePointsChanged = function(msg) | AIProxy.prototype.OnCapturePointsChanged = function(msg) | ||||
{ | { | ||||
if (!this.NotifyChange()) | if (!this.NotifyChange()) | ||||
return; | return; | ||||
this.changes.capturePoints = msg.capturePoints; | this.changes.capturePoints = msg.capturePoints; | ||||
}; | }; | ||||
AIProxy.prototype.OnInvulnerabilityChanged = function(msg) | AIProxy.prototype.OnInvulnerabilityChanged = function(msg) | ||||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | AIProxy.prototype.OnTerritoryDecayChanged = function(msg) | ||||
if (!this.NotifyChange()) | if (!this.NotifyChange()) | ||||
return; | return; | ||||
this.changes.decaying = msg.to; | this.changes.decaying = msg.to; | ||||
this.cmpAIInterface.PushEvent("TerritoryDecayChanged", msg); | this.cmpAIInterface.PushEvent("TerritoryDecayChanged", msg); | ||||
}; | }; | ||||
// TODO: event handlers for all the other things | // TODO: event handlers for all the other things | ||||
AIProxy.prototype.GetFullRepresentation = function() | AIProxy.prototype.GetFullRepresentation = function() | ||||
Silier: i think you need it here also | |||||
{ | { | ||||
this.needsFullGet = false; | this.needsFullGet = false; | ||||
let cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager); | let cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager); | ||||
let ret = { | let ret = { | ||||
// These properties are constant and won't need to be updated | // These properties are constant and won't need to be updated | ||||
"id": this.entity, | "id": this.entity, | ||||
"template": cmpTemplateManager.GetCurrentTemplateName(this.entity) | "template": cmpTemplateManager.GetCurrentTemplateName(this.entity) | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
i think you need it here also