@woosh/meep-engine 2.46.17 → 2.46.19

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.17",
7
+ "version": "2.46.19",
8
8
  "main": "build/meep.module.js",
9
9
  "module": "build/meep.module.js",
10
10
  "scripts": {
@@ -326,7 +326,7 @@ export class NodeGraph {
326
326
  const n = connections.length;
327
327
 
328
328
  for (let i = 0; i < n; i++) {
329
- const connection = connections[i];
329
+ const connection = connections.get(i);
330
330
 
331
331
  if (connection.id === id) {
332
332
  return connection;
@@ -51,6 +51,29 @@ test("createConnection populates NodeInstance.connections", () => {
51
51
  expect(g.getNode(i1).connections.length).toBe(1);
52
52
  });
53
53
 
54
+ test("getConnection", () => {
55
+
56
+ const g = new NodeGraph();
57
+
58
+ const node = new NodeDescription();
59
+
60
+ const dt = new DataType();
61
+
62
+ const pInt = node.createPort(dt, "in", PortDirection.In);
63
+ const pOut = node.createPort(dt, "out", PortDirection.Out);
64
+
65
+ const i0 = g.createNode(node);
66
+ const i1 = g.createNode(node);
67
+
68
+ const connectionId = g.createConnection(i0, pOut, i1, pInt);
69
+
70
+ const connection = g.getConnection(connectionId);
71
+
72
+ expect(connection).toBeDefined();
73
+ expect(connection.id).toBe(connectionId);
74
+
75
+ });
76
+
54
77
  test('getNode produces correct result', () => {
55
78
  const graph = new NodeGraph();
56
79
 
@@ -151,9 +151,10 @@ export class NodeInstance {
151
151
  this.description = node;
152
152
 
153
153
  //generate endpoints
154
- this.endpoints = node.getPorts().map(port => {
154
+ this.endpoints = node.getPorts().map((port, port_index) => {
155
155
  const endpoint = new NodeInstancePortReference();
156
156
 
157
+ endpoint.id = port_index;
157
158
  endpoint.port = port;
158
159
  endpoint.instance = this;
159
160