Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Builder.js
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | for (var i = entities.length - 1; i >= 0; --i) | ||||
if (disabledEntities[entities[i]]) | if (disabledEntities[entities[i]]) | ||||
entities.splice(i, 1); | entities.splice(i, 1); | ||||
} | } | ||||
return entities; | return entities; | ||||
}; | }; | ||||
Builder.prototype.GetRange = function() | Builder.prototype.GetRange = function() | ||||
{ | { | ||||
var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); | return { "max": 1, "min": 0 }; | ||||
var max = 2; | |||||
if (cmpObstruction) | |||||
max += cmpObstruction.GetUnitRadius(); | |||||
return { "max": max, "min": 0 }; | |||||
}; | }; | ||||
/** | /** | ||||
* Build/repair the target entity. This should only be called after a successful range check. | * Build/repair the target entity. This should only be called after a successful range check. | ||||
* It should be called at a rate of once per second. | * It should be called at a rate of once per second. | ||||
* Returns obj with obj.finished==true if this is a repair and it's fully repaired. | * Returns obj with obj.finished==true if this is a repair and it's fully repaired. | ||||
*/ | */ | ||||
Builder.prototype.PerformBuilding = function(target) | Builder.prototype.PerformBuilding = function(target) | ||||
Show All 21 Lines |
Wildfire Games · Phabricator