Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Repairable.js
Show All 27 Lines | if (!cmpHealth) | ||||
return 0; | return 0; | ||||
var hitpoints = cmpHealth.GetHitpoints(); | var hitpoints = cmpHealth.GetHitpoints(); | ||||
var maxHitpoints = cmpHealth.GetMaxHitpoints(); | var maxHitpoints = cmpHealth.GetMaxHitpoints(); | ||||
return hitpoints / maxHitpoints; | return hitpoints / maxHitpoints; | ||||
}; | }; | ||||
/** | |||||
* Returns the current builders. | |||||
* | |||||
* @return {number[]} An array containing the entity IDs of assigned builders. | |||||
*/ | |||||
Repairable.prototype.GetBuilders = function() | |||||
{ | |||||
return Array.from(this.builders.keys()); | |||||
}; | |||||
Repairable.prototype.GetNumBuilders = function() | Repairable.prototype.GetNumBuilders = function() | ||||
{ | { | ||||
return this.builders.size; | return this.builders.size; | ||||
}; | }; | ||||
Repairable.prototype.AddBuilder = function(builderEnt) | Repairable.prototype.AddBuilder = function(builderEnt) | ||||
{ | { | ||||
if (this.builders.has(builderEnt)) | if (this.builders.has(builderEnt)) | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator