Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/ResourceSupply.js
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | ResourceSupply.prototype.GetMaxGatherers = function() | ||||
return +this.template.MaxGatherers; | return +this.template.MaxGatherers; | ||||
}; | }; | ||||
ResourceSupply.prototype.GetNumGatherers = function() | ResourceSupply.prototype.GetNumGatherers = function() | ||||
{ | { | ||||
return this.gatherers.reduce((a, b) => a + b.length, 0); | return this.gatherers.reduce((a, b) => a + b.length, 0); | ||||
}; | }; | ||||
ResourceSupply.prototype.GetFreeSpots = function() | |||||
{ | |||||
return +this.template.MaxGatherers - this.GetNumGatherers(); | |||||
}; | |||||
/** | /** | ||||
* @return {{ "generic": string, "specific": string }} An object containing the subtype and the generic type. All resources must have both. | * @return {{ "generic": string, "specific": string }} An object containing the subtype and the generic type. All resources must have both. | ||||
*/ | */ | ||||
ResourceSupply.prototype.GetType = function() | ResourceSupply.prototype.GetType = function() | ||||
{ | { | ||||
return this.cachedType; | return this.cachedType; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator