2010-05-15 23:07:52 +02:00
|
|
|
function ResourceDropsite() {}
|
|
|
|
|
|
|
|
ResourceDropsite.prototype.Schema =
|
|
|
|
"<element name='Types'>" +
|
|
|
|
"<list>" +
|
|
|
|
"<oneOrMore>" +
|
|
|
|
"<choice>" +
|
|
|
|
"<value>food</value>" +
|
|
|
|
"<value>wood</value>" +
|
|
|
|
"<value>stone</value>" +
|
|
|
|
"<value>metal</value>" +
|
|
|
|
"</choice>" +
|
|
|
|
"</oneOrMore>" +
|
|
|
|
"</list>" +
|
|
|
|
"</element>";
|
|
|
|
|
2010-11-13 20:15:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the list of resource types accepted by this dropsite.
|
|
|
|
*/
|
|
|
|
ResourceDropsite.prototype.GetTypes = function()
|
|
|
|
{
|
|
|
|
return this.template.Types.split(/\s+/);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether this dropsite accepts the given generic type of resource.
|
2010-05-15 23:07:52 +02:00
|
|
|
*/
|
2010-11-13 20:15:29 +01:00
|
|
|
ResourceDropsite.prototype.AcceptsType = function(type)
|
|
|
|
{
|
|
|
|
return this.GetTypes().indexOf(type) != -1;
|
|
|
|
};
|
2010-05-15 23:07:52 +02:00
|
|
|
|
|
|
|
Engine.RegisterComponentType(IID_ResourceDropsite, "ResourceDropsite", ResourceDropsite);
|