1
0
forked from 0ad/0ad
0ad/binaries/data/mods/public/simulation/components/ResourceDropsite.js
Ykkrosh 4100a13e0a # Add resource shuttling.
Add resource-carrying animations/props to an actor for testing.
Warn more quietly about invalid cursor names.

This was SVN commit r8589.
2010-11-13 19:15:29 +00:00

35 lines
784 B
JavaScript

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>";
/**
* 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.
*/
ResourceDropsite.prototype.AcceptsType = function(type)
{
return this.GetTypes().indexOf(type) != -1;
};
Engine.RegisterComponentType(IID_ResourceDropsite, "ResourceDropsite", ResourceDropsite);