Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/common-api/entity.js
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | m.Template = m.Class({ | ||||
}, | }, | ||||
"cost": function(productionQueue) { | "cost": function(productionQueue) { | ||||
if (!this.get("Cost")) | if (!this.get("Cost")) | ||||
return undefined; | return undefined; | ||||
let ret = {}; | let ret = {}; | ||||
for (let type in this.get("Cost/Resources")) | for (let type in this.get("Cost/Resources")) | ||||
ret[type] = +this.get("Cost/Resources/" + type); | ret[type] = Math.round(+this.get("Cost/Resources/" + type)); | ||||
return ret; | return ret; | ||||
}, | }, | ||||
"costSum": function(productionQueue) { | "costSum": function(productionQueue) { | ||||
let cost = this.cost(productionQueue); | let cost = this.cost(productionQueue); | ||||
if (!cost) | if (!cost) | ||||
return undefined; | return undefined; | ||||
let ret = 0; | let ret = 0; | ||||
▲ Show 20 Lines • Show All 832 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator