@woosh/meep-engine 2.44.0 → 2.44.1

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.
@@ -59,6 +59,22 @@ export class NodeGraph {
59
59
  this.connections.forEach(visitor, thisArg);
60
60
  }
61
61
 
62
+ /**
63
+ * Returns an array of all node instances, note that this array is a copy
64
+ * @return {NodeInstance[]}
65
+ */
66
+ getNodes() {
67
+ return this.nodes.data.slice();
68
+ }
69
+
70
+ /**
71
+ * Returns an array of all connections, note that this array is a copy
72
+ * @return {Connection[]}
73
+ */
74
+ getConnections() {
75
+ return this.connections.data.slice();
76
+ }
77
+
62
78
  /**
63
79
  *
64
80
  * @param {number} id
@@ -2,6 +2,7 @@ import { assert } from "../../../assert.js";
2
2
  import { NodeParameterDataType } from "./parameter/NodeParameterDataType.js";
3
3
  import { NodeParameterDescription } from "./parameter/NodeParameterDescription.js";
4
4
  import { Port } from "./Port.js";
5
+ import { PortDirection } from "./PortDirection.js";
5
6
 
6
7
 
7
8
  /**
@@ -192,6 +193,34 @@ export class NodeDescription {
192
193
  return undefined;
193
194
  }
194
195
 
196
+ /**
197
+ *
198
+ * @param {PortDirection} direction
199
+ * @return {Port[]}
200
+ */
201
+ getPortsByDirection(direction) {
202
+ assert.enum(direction, PortDirection, 'direction');
203
+
204
+ /**
205
+ *
206
+ * @type {Port[]}
207
+ */
208
+ const result = [];
209
+
210
+ const ports = this.ports;
211
+ const port_count = ports.length;
212
+
213
+ for (let i = 0; i < port_count; i++) {
214
+ const port = ports[i];
215
+
216
+ if (port.direction === direction) {
217
+ result.push(port)
218
+ }
219
+ }
220
+
221
+ return result;
222
+ }
223
+
195
224
  /**
196
225
  *
197
226
  * @returns {Port[]}
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.44.0",
8
+ "version": "2.44.1",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",