Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/tooltips.js
Show First 20 Lines • Show All 339 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Multiplies the costs for a template by a given batch size. | * Multiplies the costs for a template by a given batch size. | ||||
*/ | */ | ||||
function multiplyEntityCosts(template, trainNum) | function multiplyEntityCosts(template, trainNum) | ||||
{ | { | ||||
let totalCosts = {}; | let totalCosts = {}; | ||||
for (let r in template.cost) | for (let r in template.cost) | ||||
totalCosts[r] = Math.floor(template.cost[r] * trainNum); | totalCosts[r] = Number(template.cost[r] * trainNum); | ||||
return totalCosts; | return totalCosts; | ||||
} | } | ||||
/** | /** | ||||
* Helper function for getEntityCostTooltip. | * Helper function for getEntityCostTooltip. | ||||
*/ | */ | ||||
function getEntityCostComponentsTooltipString(template, trainNum, entity) | function getEntityCostComponentsTooltipString(template, trainNum, entity) | ||||
▲ Show 20 Lines • Show All 355 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator