Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/TreasureCollector.js
function TreasureCollector() {} | function TreasureCollector() {} | ||||
TreasureCollector.prototype.Schema = | TreasureCollector.prototype.Schema = | ||||
"<a:help>Defines the treasure collecting abilities.</a:help>" + | "<a:help>Defines the treasure collecting abilities.</a:help>" + | ||||
"<a:example>" + | "<a:example>" + | ||||
"<MaxDistance>2.0</MaxDistance>" + | "<MaxDistance>2.0</MaxDistance>" + | ||||
"</a:example>" + | "</a:example>" + | ||||
"<element name='MaxDistance' a:help='The maximum treasure taking distance in m.'>" + | "<element name='MaxDistance' a:help='The maximum treasure taking distance in m.'>" + | ||||
"<ref name='positiveDecimal'/>" + | "<ref name='positiveDecimal'/>" + | ||||
"</element>"; | "</element>"; | ||||
TreasureCollector.prototype.Init = function() | TreasureCollector.prototype.Init = function() | ||||
{ | { | ||||
}; | }; | ||||
TreasureCollector.prototype.Update = function(newTemplate) | |||||
{ | |||||
this.template = newTemplate; | |||||
}; | |||||
/** | /** | ||||
* @return {Object} - Min/Max range at which this entity can claim a treasure. | * @return {Object} - Min/Max range at which this entity can claim a treasure. | ||||
*/ | */ | ||||
TreasureCollector.prototype.GetRange = function() | TreasureCollector.prototype.GetRange = function() | ||||
{ | { | ||||
return { "min": 0, "max": +this.template.MaxDistance }; | return { "min": 0, "max": +this.template.MaxDistance }; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator