@woosh/meep-engine 2.126.15 → 2.126.16
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 +1 -1
- package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.d.ts +3 -0
- package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +3 -0
- package/src/engine/ecs/storage/binary/BinaryClassUpgrader.d.ts +5 -0
- package/src/engine/ecs/storage/binary/BinaryClassUpgrader.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/BinaryClassUpgrader.js +6 -0
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts +9 -5
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +29 -9
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.d.ts +5 -0
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js +78 -75
- package/src/engine/ecs/storage/binary/executeBinaryClassUpgraderChain.d.ts +3 -3
- package/src/engine/ecs/storage/binary/executeBinaryClassUpgraderChain.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/executeBinaryClassUpgraderChain.js +12 -6
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.
|
|
8
|
+
"version": "2.126.16",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinaryClassSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BinaryClassSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;IAEI;;;;OAIG;IACH,iBAFU,KAAK,CAEF;IAEb;;;;;;OAMG;IACH,mBAFU,MAAM,CAEJ;IAEZ;;;OAGG;IACH,SAHa,CAAC,KACD,KAAK,CAAC,CAAC,CAAC,CAIpB;IAED;;;OAGG;IACH,cAFa,MAAM,CAIlB;IAED,iCAEC;IAED;;;OAGG;IACH,iBAEC;IAED;;;OAGG;IACH,kBAHW,YAAY,oBAKtB;IAED;;;;OAIG;IACH,oBAHW,YAAY,oBAKtB;IAGL;;;OAGG;IACH,4CAFU,OAAO,CAE0D;CAN1E"}
|
|
@@ -28,5 +28,10 @@ export class BinaryClassUpgrader {
|
|
|
28
28
|
* @returns {void}
|
|
29
29
|
*/
|
|
30
30
|
upgrade(source: BinaryBuffer, target: BinaryBuffer): void;
|
|
31
|
+
/**
|
|
32
|
+
* @readonly
|
|
33
|
+
* @type {boolean}
|
|
34
|
+
*/
|
|
35
|
+
readonly isBinaryClassUpgrader: boolean;
|
|
31
36
|
}
|
|
32
37
|
//# sourceMappingURL=BinaryClassUpgrader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinaryClassUpgrader.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/storage/binary/BinaryClassUpgrader.js"],"names":[],"mappings":"AAAA;IAEI;;;;OAIG;IACH,0BAHU,MAAM,CAGG;IACnB;;;;OAIG;IACH,2BAHU,MAAM,CAGI;IAEpB;;;OAGG;IACH,mBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,oBAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,gBAJW,YAAY,UACZ,YAAY,GACV,IAAI,CAIhB;
|
|
1
|
+
{"version":3,"file":"BinaryClassUpgrader.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/storage/binary/BinaryClassUpgrader.js"],"names":[],"mappings":"AAAA;IAEI;;;;OAIG;IACH,0BAHU,MAAM,CAGG;IACnB;;;;OAIG;IACH,2BAHU,MAAM,CAGI;IAEpB;;;OAGG;IACH,mBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,oBAFa,MAAM,CAIlB;IAED;;;;;OAKG;IACH,gBAJW,YAAY,UACZ,YAAY,GACV,IAAI,CAIhB;IAGL;;;OAGG;IACH,gCAFU,OAAO,CAEkC;CANlD"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Contains serializers for various data types as well as data upgraders which enable support for serialization format changes
|
|
3
|
+
*
|
|
4
|
+
* @author Alex Goldring
|
|
5
|
+
* @copyright Company Named Limited (c) 2025
|
|
3
6
|
*/
|
|
4
7
|
export class BinarySerializationRegistry {
|
|
5
8
|
/**
|
|
@@ -21,17 +24,18 @@ export class BinarySerializationRegistry {
|
|
|
21
24
|
registerAdapters(adapters: BinaryClassSerializationAdapter[]): void;
|
|
22
25
|
/**
|
|
23
26
|
*
|
|
24
|
-
* @param {string} [className]
|
|
25
27
|
* @param {BinaryClassSerializationAdapter} adapter
|
|
26
|
-
* @
|
|
28
|
+
* @param {string} [className] if not specified, will be taken from the {@link BinaryClassSerializationAdapter.klass.typeName}
|
|
29
|
+
* @returns {boolean} true if added, false if adapter already existed
|
|
30
|
+
* @throws {Error} if `className` could not be inferred
|
|
27
31
|
*/
|
|
28
32
|
registerAdapter(adapter: BinaryClassSerializationAdapter, className?: string): boolean;
|
|
29
33
|
/**
|
|
30
34
|
*
|
|
31
35
|
* @param {string} className
|
|
32
|
-
* @returns {BinaryClassSerializationAdapter}
|
|
36
|
+
* @returns {BinaryClassSerializationAdapter|undefined}
|
|
33
37
|
*/
|
|
34
|
-
removeAdapter(className: string): BinaryClassSerializationAdapter;
|
|
38
|
+
removeAdapter(className: string): BinaryClassSerializationAdapter | undefined;
|
|
35
39
|
/**
|
|
36
40
|
*
|
|
37
41
|
* @param {string} className
|
|
@@ -42,7 +46,7 @@ export class BinarySerializationRegistry {
|
|
|
42
46
|
*
|
|
43
47
|
* @param {string} className
|
|
44
48
|
* @param {BinaryClassUpgrader} upgrader
|
|
45
|
-
* @returns {boolean}
|
|
49
|
+
* @returns {boolean} true iff added, false if already exists
|
|
46
50
|
*/
|
|
47
51
|
registerUpgrader(className: string, upgrader: BinaryClassUpgrader): boolean;
|
|
48
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinarySerializationRegistry.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/storage/binary/BinarySerializationRegistry.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"BinarySerializationRegistry.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/storage/binary/BinarySerializationRegistry.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH;IAEI;;;;OAIG;IACH,2BAAsB;IACtB;;;;OAIG;IACH,6BAAwB;IAExB;;;OAGG;IACH,2BAFW,+BAA+B,EAAE,QAM3C;IAED;;;;;;OAMG;IACH,yBALW,+BAA+B,cAC/B,MAAM,GACJ,OAAO,CAkCnB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,+BAA+B,GAAC,SAAS,CAYrD;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,+BAA+B,GAAC,SAAS,CAMrD;IAED;;;;;OAKG;IACH,4BAJW,MAAM,YACN,mBAAmB,GACjB,OAAO,CA6CnB;IAED;;;;;;OAMG;IACH,6BALW,MAAM,gBACN,MAAM,eACN,MAAM,GACJ,mBAAmB,EAAE,GAAC,IAAI,CA0DtC;IAIL;;;OAGG;IACH,wCAFU,OAAO,CAEkD;CANlE"}
|
|
@@ -3,6 +3,9 @@ import { Graph } from "../../../../core/graph/v2/Graph.js";
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Contains serializers for various data types as well as data upgraders which enable support for serialization format changes
|
|
6
|
+
*
|
|
7
|
+
* @author Alex Goldring
|
|
8
|
+
* @copyright Company Named Limited (c) 2025
|
|
6
9
|
*/
|
|
7
10
|
export class BinarySerializationRegistry {
|
|
8
11
|
|
|
@@ -31,9 +34,10 @@ export class BinarySerializationRegistry {
|
|
|
31
34
|
|
|
32
35
|
/**
|
|
33
36
|
*
|
|
34
|
-
* @param {string} [className]
|
|
35
37
|
* @param {BinaryClassSerializationAdapter} adapter
|
|
36
|
-
* @
|
|
38
|
+
* @param {string} [className] if not specified, will be taken from the {@link BinaryClassSerializationAdapter.klass.typeName}
|
|
39
|
+
* @returns {boolean} true if added, false if adapter already existed
|
|
40
|
+
* @throws {Error} if `className` could not be inferred
|
|
37
41
|
*/
|
|
38
42
|
registerAdapter(adapter, className) {
|
|
39
43
|
assert.defined(adapter, 'adapter');
|
|
@@ -44,15 +48,19 @@ export class BinarySerializationRegistry {
|
|
|
44
48
|
if (_className === undefined) {
|
|
45
49
|
const klass = adapter.getClass();
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
const typeName = klass.typeName;
|
|
52
|
+
|
|
53
|
+
if (typeof typeName === "string") {
|
|
54
|
+
_className = typeName;
|
|
49
55
|
} else {
|
|
50
56
|
throw new Error(`className not specified, could not infer class name from the class itself`);
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
|
|
60
|
+
assert.isString(_className, 'className');
|
|
61
|
+
|
|
54
62
|
if (this.serializers.has(_className)) {
|
|
55
|
-
//a serializer already exists
|
|
63
|
+
// a serializer already exists
|
|
56
64
|
|
|
57
65
|
console.warn(`Serializer for class '${_className}' already exists, ignoring request`);
|
|
58
66
|
|
|
@@ -67,9 +75,11 @@ export class BinarySerializationRegistry {
|
|
|
67
75
|
/**
|
|
68
76
|
*
|
|
69
77
|
* @param {string} className
|
|
70
|
-
* @returns {BinaryClassSerializationAdapter}
|
|
78
|
+
* @returns {BinaryClassSerializationAdapter|undefined}
|
|
71
79
|
*/
|
|
72
80
|
removeAdapter(className) {
|
|
81
|
+
assert.isString(className, 'className');
|
|
82
|
+
|
|
73
83
|
const adapter = this.serializers.get(className);
|
|
74
84
|
|
|
75
85
|
if (adapter !== undefined) {
|
|
@@ -85,6 +95,8 @@ export class BinarySerializationRegistry {
|
|
|
85
95
|
* @returns {BinaryClassSerializationAdapter|undefined}
|
|
86
96
|
*/
|
|
87
97
|
getAdapter(className) {
|
|
98
|
+
assert.isString(className, 'className');
|
|
99
|
+
|
|
88
100
|
return this.serializers.get(className);
|
|
89
101
|
}
|
|
90
102
|
|
|
@@ -92,9 +104,13 @@ export class BinarySerializationRegistry {
|
|
|
92
104
|
*
|
|
93
105
|
* @param {string} className
|
|
94
106
|
* @param {BinaryClassUpgrader} upgrader
|
|
95
|
-
* @returns {boolean}
|
|
107
|
+
* @returns {boolean} true iff added, false if already exists
|
|
96
108
|
*/
|
|
97
109
|
registerUpgrader(className, upgrader) {
|
|
110
|
+
assert.isString(className, 'className');
|
|
111
|
+
assert.defined(upgrader, 'upgrader');
|
|
112
|
+
assert.notNull(upgrader, 'upgrader');
|
|
113
|
+
assert.equal(upgrader.isBinaryClassUpgrader, true, 'upgrader.isBinaryClassUpgrader !== true');
|
|
98
114
|
|
|
99
115
|
if (upgrader.getStartVersion() === upgrader.getTargetVersion()) {
|
|
100
116
|
throw new Error(`Upgrader for '${className}' start(=${upgrader.getStartVersion()}) and target(=${upgrader.getTargetVersion()}) versions are the same, must be different`);
|
|
@@ -113,13 +129,13 @@ export class BinarySerializationRegistry {
|
|
|
113
129
|
}
|
|
114
130
|
|
|
115
131
|
if (classUpgraders.hasNode(upgrader)) {
|
|
116
|
-
//upgrader already registered
|
|
132
|
+
// upgrader already registered
|
|
117
133
|
return false;
|
|
118
134
|
}
|
|
119
135
|
|
|
120
136
|
classUpgraders.addNode(upgrader);
|
|
121
137
|
|
|
122
|
-
//find other upgraders that would connect to this upgrader
|
|
138
|
+
// find other upgraders that would connect to this upgrader
|
|
123
139
|
classUpgraders.traverseNodes(u => {
|
|
124
140
|
if (u === upgrader) {
|
|
125
141
|
return;
|
|
@@ -143,6 +159,10 @@ export class BinarySerializationRegistry {
|
|
|
143
159
|
* @returns {BinaryClassUpgrader[]|null} sequential shortest chain of upgraders or null if no valid chain exists
|
|
144
160
|
*/
|
|
145
161
|
getUpgradersChain(className, startVersion, goalVersion) {
|
|
162
|
+
assert.isString(className, 'className');
|
|
163
|
+
assert.isNumber(startVersion, 'startVersion');
|
|
164
|
+
assert.isNumber(goalVersion, 'goalVersion');
|
|
165
|
+
|
|
146
166
|
if (startVersion === goalVersion) {
|
|
147
167
|
//already at the goal version
|
|
148
168
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinaryCollectionDeSerializer.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BinaryCollectionDeSerializer.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH;IAEI;;;OAGG;IACH,iBAAgB;IAEhB;;;OAGG;IACH,eAAc;IAEd;;;;OAIG;IACH,4BAA4B;IAC5B;;;;OAIG;IACH,0BAA0B;IAE1B;;;OAGG;IACH,qBAAiB;IAEjB;;;OAGG;IACH,qBAAiB;IAEjB;;;OAGG;IACH,qBAAiB;IAEjB;;;OAGG;IACH,gBAAe;IAEf;;;OAGG;IACH,kBAAiB;IAEjB;;;;OAIG;IACH,yBAAsC;IACtC;;;;OAIG;IACH,yBAAsC;IAEtC;;;OAGG;IACH,cAAsB;IAGtB;;;OAGG;IACH,sBAFW,2BAA2B,QAOrC;IAED;;;OAGG;IACH,eAFa,2BAA2B,CAIvC;IAED;;;OAGG;IACH,kBAFW,YAAY,QAOtB;IAED;;;OAGG;IACH,mBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,mBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,mBAFa,KAAK,CAAC,CAAC,CAAC,GAAC,IAAI,CAUzB;IAED;;;OAGG;IACH,wCAFW,CAAS,IAAM,EAAN,MAAM,EAAC,IAAK,EAAL,KAAK,EAAE,IAA+B,EAA/B,+BAA+B,KAAE,EAAE,QAgFpE;IAED,iBAWC;IAED;;;OAGG;IACH,uBAeC;IAED;;;OAGG;IACH,KAHa,CAAC,KACD;QAAC,KAAK,EAAE,CAAC,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,CA8DnC;CAEJ;6BAvV4B,4CAA4C"}
|
|
@@ -16,83 +16,86 @@ const State = {
|
|
|
16
16
|
Ready: 1
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @author Alex Goldring
|
|
22
|
+
* @copyright Company Named Limited (c) 2025
|
|
23
|
+
*/
|
|
20
24
|
export class BinaryCollectionDeSerializer {
|
|
21
|
-
constructor() {
|
|
22
|
-
/**
|
|
23
|
-
* @private
|
|
24
|
-
* @type {BinarySerializationRegistry}
|
|
25
|
-
*/
|
|
26
|
-
this.registry = null;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @private
|
|
30
|
-
* @type {BinaryBuffer}
|
|
31
|
-
*/
|
|
32
|
-
this.buffer = null;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @type {boolean}
|
|
37
|
-
* @private
|
|
38
|
-
*/
|
|
39
|
-
this.__dictionaryEnabled = false;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @type {boolean}
|
|
43
|
-
* @private
|
|
44
|
-
*/
|
|
45
|
-
this.__upgradeRequired = false;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @private
|
|
49
|
-
* @type {number}
|
|
50
|
-
*/
|
|
51
|
-
this.elementCount = 0;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @private
|
|
55
|
-
* @type {number}
|
|
56
|
-
*/
|
|
57
|
-
this.elementIndex = 0;
|
|
58
25
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @private
|
|
28
|
+
* @type {BinarySerializationRegistry}
|
|
29
|
+
*/
|
|
30
|
+
registry = null;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @private
|
|
34
|
+
* @type {BinaryBuffer}
|
|
35
|
+
*/
|
|
36
|
+
buffer = null;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @type {boolean}
|
|
41
|
+
* @private
|
|
42
|
+
*/
|
|
43
|
+
__dictionaryEnabled = false;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @type {boolean}
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
__upgradeRequired = false;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @private
|
|
53
|
+
* @type {number}
|
|
54
|
+
*/
|
|
55
|
+
elementCount = 0;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @private
|
|
59
|
+
* @type {number}
|
|
60
|
+
*/
|
|
61
|
+
elementIndex = 0;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @private
|
|
65
|
+
* @type {number}
|
|
66
|
+
*/
|
|
67
|
+
startAddress = 0;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @private
|
|
71
|
+
* @type {BinaryClassSerializationAdapter}
|
|
72
|
+
*/
|
|
73
|
+
adapter = null;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @private
|
|
77
|
+
* @type {BinaryClassUpgrader[]}
|
|
78
|
+
*/
|
|
79
|
+
upgraders = null;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @type {BinaryBuffer}
|
|
84
|
+
* @private
|
|
85
|
+
*/
|
|
86
|
+
__upgradeBuffer0 = new BinaryBuffer();
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @type {BinaryBuffer}
|
|
90
|
+
* @private
|
|
91
|
+
*/
|
|
92
|
+
__upgradeBuffer1 = new BinaryBuffer();
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @private
|
|
96
|
+
* @type {State}
|
|
97
|
+
*/
|
|
98
|
+
state = State.Initial;
|
|
96
99
|
|
|
97
100
|
|
|
98
101
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Upgrade binary data by executing a
|
|
2
|
+
* Upgrade binary data by executing a sequence of upgraders on it
|
|
3
3
|
* @param {BinaryClassUpgrader[]} upgraders
|
|
4
|
-
* @param {BinaryBuffer} buffer
|
|
4
|
+
* @param {BinaryBuffer} buffer input data
|
|
5
5
|
* @param {BinaryBuffer} tempBuffer0
|
|
6
6
|
* @param {BinaryBuffer} tempBuffer1
|
|
7
|
-
* @return {BinaryBuffer}
|
|
7
|
+
* @return {BinaryBuffer} buffer with upgraded data, this will be either {@link tempBuffer0} or {@link tempBuffer1}
|
|
8
8
|
*/
|
|
9
9
|
export function executeBinaryClassUpgraderChain(upgraders: BinaryClassUpgrader[], buffer: BinaryBuffer, tempBuffer0: BinaryBuffer, tempBuffer1: BinaryBuffer): BinaryBuffer;
|
|
10
10
|
//# sourceMappingURL=executeBinaryClassUpgraderChain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeBinaryClassUpgraderChain.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/storage/binary/executeBinaryClassUpgraderChain.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,2DANW,mBAAmB,EAAE,UACrB,YAAY,eACZ,YAAY,eACZ,YAAY,GACX,YAAY,
|
|
1
|
+
{"version":3,"file":"executeBinaryClassUpgraderChain.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/storage/binary/executeBinaryClassUpgraderChain.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,2DANW,mBAAmB,EAAE,UACrB,YAAY,eACZ,YAAY,eACZ,YAAY,GACX,YAAY,CA2CvB"}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Upgrade binary data by executing a
|
|
4
|
+
* Upgrade binary data by executing a sequence of upgraders on it
|
|
5
5
|
* @param {BinaryClassUpgrader[]} upgraders
|
|
6
|
-
* @param {BinaryBuffer} buffer
|
|
6
|
+
* @param {BinaryBuffer} buffer input data
|
|
7
7
|
* @param {BinaryBuffer} tempBuffer0
|
|
8
8
|
* @param {BinaryBuffer} tempBuffer1
|
|
9
|
-
* @return {BinaryBuffer}
|
|
9
|
+
* @return {BinaryBuffer} buffer with upgraded data, this will be either {@link tempBuffer0} or {@link tempBuffer1}
|
|
10
10
|
*/
|
|
11
|
-
export function executeBinaryClassUpgraderChain(
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export function executeBinaryClassUpgraderChain(
|
|
12
|
+
upgraders,
|
|
13
|
+
buffer,
|
|
14
|
+
tempBuffer0,
|
|
15
|
+
tempBuffer1
|
|
16
|
+
) {
|
|
17
|
+
assert.isArray(upgraders, 'upgraders');
|
|
18
|
+
assert.defined(buffer, 'buffer');
|
|
19
|
+
|
|
14
20
|
assert.defined(tempBuffer0);
|
|
15
21
|
assert.defined(tempBuffer1);
|
|
16
22
|
|