function ResourceDropsite() {} ResourceDropsite.prototype.Schema = "" + "" + "" + "" + "food" + "wood" + "stone" + "metal" + "" + "" + "" + "" + "" + "" + ""; ResourceDropsite.prototype.Init = function() { this.sharable = this.template.Sharable == "true"; this.shared = this.sharable; }; /** * Returns the list of resource types accepted by this dropsite. */ ResourceDropsite.prototype.GetTypes = function() { let types = ApplyValueModificationsToEntity("ResourceDropsite/Types", this.template.Types, this.entity); return types ? 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; }; ResourceDropsite.prototype.IsSharable = function() { return this.sharable; }; ResourceDropsite.prototype.IsShared = function() { return this.shared; }; ResourceDropsite.prototype.SetSharing = function(value) { if (!this.sharable) return; this.shared = value; Engine.PostMessage(this.entity, MT_DropsiteSharingChanged, { "shared": this.shared }); }; Engine.RegisterComponentType(IID_ResourceDropsite, "ResourceDropsite", ResourceDropsite);