@woosh/meep-engine 2.43.49 → 2.43.50

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.
@@ -92,6 +92,21 @@ List.prototype.add = function (el) {
92
92
  return this;
93
93
  };
94
94
 
95
+ /**
96
+ *
97
+ * @param {T} el
98
+ * @return {boolean}
99
+ */
100
+ List.prototype.addUnique = function (el) {
101
+ if (this.contains(el)) {
102
+ return false;
103
+ }
104
+
105
+ this.add(el);
106
+
107
+ return true;
108
+ }
109
+
95
110
  /**
96
111
  * Insert element at a specific position into the list
97
112
  * @param {number} index
@@ -9,7 +9,7 @@ export class DataType {
9
9
  this.id = 0;
10
10
 
11
11
  /**
12
- *
12
+ * Name is not guaranteed to be unique, it is intended mainly for debug purposes
13
13
  * @type {string}
14
14
  */
15
15
  this.name = "";
@@ -243,6 +243,10 @@ export class NodeGraph {
243
243
 
244
244
  this.connections.add(connection);
245
245
 
246
+ // add connection links to the nodes
247
+ sourceNodeInstance.connections.addUnique(connection);
248
+ targetNodeInstance.connections.addUnique(connection);
249
+
246
250
  return id;
247
251
  }
248
252
 
@@ -261,6 +265,10 @@ export class NodeGraph {
261
265
 
262
266
  this.connections.removeOneOf(connection);
263
267
 
268
+ // remove from end-point nodes
269
+ connection.source.instance.connections.removeOneOf(connection);
270
+ connection.target.instance.connections.removeOneOf(connection);
271
+
264
272
  return true;
265
273
  }
266
274
 
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.43.49",
8
+ "version": "2.43.50",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",