@woosh/meep-engine 2.46.13 → 2.46.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "productName": "Meep",
5
5
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
6
6
  "author": "Alexander Goldring",
7
- "version": "2.46.13",
7
+ "version": "2.46.14",
8
8
  "main": "build/meep.module.js",
9
9
  "module": "build/meep.module.js",
10
10
  "scripts": {
@@ -123,6 +123,18 @@ export class NodeGraph {
123
123
 
124
124
  }
125
125
 
126
+ /**
127
+ *
128
+ * @returns {NodeGraph}
129
+ */
130
+ clone() {
131
+ const r = new NodeGraph();
132
+
133
+ r.copy(this);
134
+
135
+ return r;
136
+ }
137
+
126
138
  /**
127
139
  *
128
140
  * @param {function(NodeInstance):*} visitor
@@ -203,6 +215,32 @@ export class NodeGraph {
203
215
  return result;
204
216
  }
205
217
 
218
+ /**
219
+ *
220
+ * @param {Type<NodeDescription>} Klass
221
+ * @returns {NodeInstance[]}
222
+ */
223
+ getNodesByDescriptionClass(Klass) {
224
+
225
+ assert.defined(Klass, 'Klass');
226
+ assert.notNull(Klass, 'Klass');
227
+
228
+ const result = [];
229
+
230
+ const nodes = this.nodes;
231
+ const n = nodes.length;
232
+
233
+ for (let i = 0; i < n; i++) {
234
+ const node = nodes.get(i);
235
+
236
+ if (node.description.constructor === Klass) {
237
+ result.push(node);
238
+ }
239
+ }
240
+
241
+ return result;
242
+ }
243
+
206
244
  /**
207
245
  *
208
246
  * @param {number} id