@woosh/meep-engine 2.44.1 → 2.44.2
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.
|
@@ -3,6 +3,8 @@ import List from "../../collection/list/List.js";
|
|
|
3
3
|
import IdPool from "../../IdPool.js";
|
|
4
4
|
import { Connection } from "./Connection.js";
|
|
5
5
|
import { NodeInstance } from "./node/NodeInstance.js";
|
|
6
|
+
import { array_push_if_unique } from "../../collection/array/array_push_if_unique.js";
|
|
7
|
+
import { array_remove_first } from "../../collection/array/array_remove_first.js";
|
|
6
8
|
|
|
7
9
|
export class NodeGraph {
|
|
8
10
|
constructor() {
|
|
@@ -263,6 +265,9 @@ export class NodeGraph {
|
|
|
263
265
|
sourceNodeInstance.connections.addUnique(connection);
|
|
264
266
|
targetNodeInstance.connections.addUnique(connection);
|
|
265
267
|
|
|
268
|
+
array_push_if_unique(sourceEndpoint.connections, connection);
|
|
269
|
+
array_push_if_unique(targetEndpoint.connections, connection);
|
|
270
|
+
|
|
266
271
|
return id;
|
|
267
272
|
}
|
|
268
273
|
|
|
@@ -282,8 +287,14 @@ export class NodeGraph {
|
|
|
282
287
|
this.connections.removeOneOf(connection);
|
|
283
288
|
|
|
284
289
|
// remove from end-point nodes
|
|
285
|
-
connection.source
|
|
286
|
-
connection.target
|
|
290
|
+
const sourceEndpoint = connection.source;
|
|
291
|
+
const targetEndpoint = connection.target;
|
|
292
|
+
|
|
293
|
+
sourceEndpoint.instance.connections.removeOneOf(connection);
|
|
294
|
+
targetEndpoint.instance.connections.removeOneOf(connection);
|
|
295
|
+
|
|
296
|
+
array_remove_first(sourceEndpoint.connections, connection);
|
|
297
|
+
array_remove_first(targetEndpoint.connections, connection);
|
|
287
298
|
|
|
288
299
|
return true;
|
|
289
300
|
}
|
|
@@ -20,15 +20,24 @@ export class NodeInstancePortReference {
|
|
|
20
20
|
this.id = id_counter++;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* @readonly
|
|
24
24
|
* @type {NodeInstance}
|
|
25
25
|
*/
|
|
26
26
|
this.instance = null;
|
|
27
|
+
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* @readonly
|
|
29
30
|
* @type {Port}
|
|
30
31
|
*/
|
|
31
32
|
this.port = null;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Attached connections
|
|
36
|
+
* NOTE: Maintained by NodeGraph, do not modify
|
|
37
|
+
* @readonly
|
|
38
|
+
* @type {Connection[]}
|
|
39
|
+
*/
|
|
40
|
+
this.connections = [];
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
|
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.
|
|
8
|
+
"version": "2.44.2",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"gl-matrix": "3.4.3",
|
|
11
11
|
"fast-levenshtein": "2.0.6",
|