@woosh/meep-engine 2.126.5 → 2.126.6

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
@@ -5,7 +5,7 @@
5
5
  "description": "Pure JavaScript game engine. Fully featured and production ready.",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.126.5",
8
+ "version": "2.126.6",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1,5 +1,8 @@
1
1
  export default BinaryBufferDeSerializer;
2
- declare class BinaryBufferDeSerializer {
2
+ /**
3
+ * @template CTX
4
+ */
5
+ declare class BinaryBufferDeSerializer<CTX> {
3
6
  /**
4
7
  *
5
8
  * @type {BinarySerializationRegistry}
@@ -8,11 +11,11 @@ declare class BinaryBufferDeSerializer {
8
11
  /**
9
12
  *
10
13
  * @param {BinaryBuffer} buffer
11
- * @param {Engine} engine
14
+ * @param {CTX} context
12
15
  * @param {EntityComponentDataset} dataset
13
16
  * @returns {Task}
14
17
  */
15
- process(buffer: BinaryBuffer, engine: Engine, dataset: EntityComponentDataset): Task;
18
+ process(buffer: BinaryBuffer, context: CTX, dataset: EntityComponentDataset): Task;
16
19
  }
17
20
  import Task from "../../../core/process/task/Task.js";
18
21
  //# sourceMappingURL=BinaryBufferDeSerializer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BinaryBufferDeSerializer.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/storage/BinaryBufferDeSerializer.js"],"names":[],"mappings":";AAQA;IACI;;;OAGG;IACH,UAFU,2BAA2B,CAErB;IAEhB;;;;;;OAMG;IACH,gBALW,YAAY,UACZ,MAAM,WACN,sBAAsB,GACpB,IAAI,CA8BhB;CACJ;iBAjDgB,oCAAoC"}
1
+ {"version":3,"file":"BinaryBufferDeSerializer.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/storage/BinaryBufferDeSerializer.js"],"names":[],"mappings":";AAQA;;GAEG;AACH,uCAFa,GAAG;IAGZ;;;OAGG;IACH,UAFU,2BAA2B,CAErB;IAEhB;;;;;;OAMG;IACH,gBALW,YAAY,WACZ,GAAG,WACH,sBAAsB,GACpB,IAAI,CA8BhB;CACJ;iBApDgB,oCAAoC"}
@@ -6,6 +6,9 @@ import { emptyTask } from "../../../core/process/task/util/emptyTask.js";
6
6
  import { BinaryCollectionDeSerializer } from "./binary/collection/BinaryCollectionDeSerializer.js";
7
7
  import { BinaryObjectSerializationAdapter } from "./binary/object/BinaryObjectSerializationAdapter.js";
8
8
 
9
+ /**
10
+ * @template CTX
11
+ */
9
12
  class BinaryBufferDeSerializer {
10
13
  /**
11
14
  *
@@ -16,14 +19,14 @@ class BinaryBufferDeSerializer {
16
19
  /**
17
20
  *
18
21
  * @param {BinaryBuffer} buffer
19
- * @param {Engine} engine
22
+ * @param {CTX} context
20
23
  * @param {EntityComponentDataset} dataset
21
24
  * @returns {Task}
22
25
  */
23
- process(buffer, engine, dataset) {
24
- assert.notEqual(buffer, undefined, 'buffer is undefined');
25
- assert.notEqual(engine, undefined, 'engine is undefined');
26
- assert.notEqual(dataset, undefined, 'dataset is undefined');
26
+ process(buffer, context, dataset) {
27
+ assert.defined(buffer, 'buffer');
28
+ assert.defined(context, 'context');
29
+ assert.defined(dataset, 'dataset');
27
30
 
28
31
  const entity_count_before = dataset.entityCount;
29
32
 
@@ -35,7 +38,7 @@ class BinaryBufferDeSerializer {
35
38
  //return NO-OP equivalent of a task
36
39
  task = emptyTask();
37
40
  } else {
38
- task = deserializeTask(numSerializedTypes, buffer, engine, dataset, this.registry);
41
+ task = deserializeTask(numSerializedTypes, buffer, context, dataset, this.registry);
39
42
  }
40
43
 
41
44
  task.on.completed.add(function () {
@@ -52,10 +55,10 @@ class BinaryBufferDeSerializer {
52
55
  }
53
56
 
54
57
  /**
55
- *
58
+ * @template CTX
56
59
  * @param {number} numSerializedTypes
57
60
  * @param {BinaryBuffer} buffer
58
- * @param {Engine} engine
61
+ * @param {CTX} context
59
62
  * @param {EntityComponentDataset} dataset
60
63
  * @param {BinarySerializationRegistry}registry
61
64
  * @returns {Task}
@@ -63,13 +66,13 @@ class BinaryBufferDeSerializer {
63
66
  function deserializeTask(
64
67
  numSerializedTypes,
65
68
  buffer,
66
- engine,
69
+ context,
67
70
  dataset,
68
71
  registry
69
72
  ) {
70
73
 
71
- assert.defined(engine, 'engine');
72
- assert.ok(engine.isEngine, 'is not Engine');
74
+ assert.defined(context, 'context');
75
+ assert.notNull(context, 'context');
73
76
 
74
77
 
75
78
  let typesDecoded = 0;
@@ -117,7 +120,7 @@ function deserializeTask(
117
120
  * @param {BinaryClassSerializationAdapter} adapter
118
121
  */
119
122
  adapterOptionsSupplier(className, klass, adapter) {
120
- return [engine, objectAdapter];
123
+ return [context, objectAdapter];
121
124
  }
122
125
  });
123
126
  } catch (e) {