This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/misc/Legacy Worlds.wdgt/lib/LWWidget/Data/Node.js

25 lines
498 B
JavaScript

LWWidget.Data.Node = LWWidget.Data.inherits({
constructor: function (name) {
this.base(name);
this.contents = new Array();
},
addChild: function (child) {
if (child instanceof LWWidget.Data.Node || child instanceof LWWidget.Data.Leaf) {
this.contents.push(child);
}
},
getChildren: function (name) {
var _c = new Array();
for (var i in this.contents) {
if (this.contents[i] && this.contents[i].name == name) {
_c.push(this.contents[i]);
}
}
return _c;
}
});