@woosh/meep-engine 2.119.76 → 2.119.77
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/core/binary/type/dataTypeFromTypedArray.d.ts.map +1 -1
- package/src/core/binary/type/dataTypeFromTypedArray.js +4 -1
- package/src/engine/ecs/components/Tag.d.ts +113 -31
- package/src/engine/ecs/components/Tag.d.ts.map +1 -1
- package/src/engine/ecs/components/Tag.js +17 -0
- package/src/engine/ecs/components/TagSerializationAdapter.d.ts +14 -0
- package/src/engine/ecs/components/TagSerializationAdapter.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataTypeFromTypedArray.d.ts","sourceRoot":"","sources":["../../../../../src/core/binary/type/dataTypeFromTypedArray.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,yDAFa,cAAc,
|
|
1
|
+
{"version":3,"file":"dataTypeFromTypedArray.d.ts","sourceRoot":"","sources":["../../../../../src/core/binary/type/dataTypeFromTypedArray.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,yDAFa,cAAc,CA4B1B;+BAjC8B,qBAAqB"}
|
|
@@ -10,7 +10,10 @@ export function dataTypeFromTypedArray(arr) {
|
|
|
10
10
|
return BinaryDataType.Float32;
|
|
11
11
|
} else if (arr instanceof Float64Array) {
|
|
12
12
|
return BinaryDataType.Float64;
|
|
13
|
-
} else if (
|
|
13
|
+
} else if (
|
|
14
|
+
arr instanceof Uint8Array
|
|
15
|
+
|| arr instanceof Uint8ClampedArray
|
|
16
|
+
) {
|
|
14
17
|
return BinaryDataType.Uint8;
|
|
15
18
|
} else if (arr instanceof Uint16Array) {
|
|
16
19
|
return BinaryDataType.Uint16;
|
|
@@ -1,31 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Stores textual tags, useful for marking entities
|
|
3
|
+
*/
|
|
4
|
+
export class Tag {
|
|
5
|
+
/**
|
|
6
|
+
* Find all entities that contain specified tags. Entity must have every tag to qualify
|
|
7
|
+
* @param {string[]} tags
|
|
8
|
+
* @param {EntityComponentDataset} ecd
|
|
9
|
+
* @returns {number[]} entities
|
|
10
|
+
*/
|
|
11
|
+
static find(tags: string[], ecd: EntityComponentDataset): number[];
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param {string} tag
|
|
15
|
+
* @returns {Tag}
|
|
16
|
+
*/
|
|
17
|
+
static fromOne(tag: string): Tag;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param json
|
|
21
|
+
* @returns {Tag}
|
|
22
|
+
*/
|
|
23
|
+
static fromJSON(json: any): Tag;
|
|
24
|
+
/**
|
|
25
|
+
* Utility constructor
|
|
26
|
+
* @param {string} label
|
|
27
|
+
* @return {Tag}
|
|
28
|
+
*/
|
|
29
|
+
static from(...label: string): Tag;
|
|
30
|
+
/**
|
|
31
|
+
* @private
|
|
32
|
+
* @type {string[]}
|
|
33
|
+
*/
|
|
34
|
+
private values;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @returns {number}
|
|
38
|
+
*/
|
|
39
|
+
get count(): number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param {number} i
|
|
43
|
+
* @returns {String}
|
|
44
|
+
*/
|
|
45
|
+
get(i: number): string;
|
|
46
|
+
clear(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Once the tag is added to the dataset it should be considered immutable, hence why this method is protected
|
|
49
|
+
* @param {String} value
|
|
50
|
+
* @returns {boolean}
|
|
51
|
+
*/
|
|
52
|
+
add(value: string): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Add multiple tags
|
|
55
|
+
* @param {string[]} values
|
|
56
|
+
*/
|
|
57
|
+
addAll(values: string[]): void;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @returns {String}
|
|
61
|
+
*/
|
|
62
|
+
getFirst(): string;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param {String} value
|
|
66
|
+
* @returns {boolean}
|
|
67
|
+
*/
|
|
68
|
+
contains(value: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @param {string[]} values
|
|
72
|
+
*/
|
|
73
|
+
containsAll(values: string[]): boolean;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @param {String[]} values
|
|
77
|
+
* @returns {boolean}
|
|
78
|
+
*/
|
|
79
|
+
containsOneOf(values: string[]): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* NOTE: do not modify this value
|
|
82
|
+
* @returns {string[]}
|
|
83
|
+
*/
|
|
84
|
+
getValues(): string[];
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param {function(string)} visitor
|
|
88
|
+
* @param {*} [thisArg]
|
|
89
|
+
*/
|
|
90
|
+
traverse(visitor: (arg0: string) => any, thisArg?: any): void;
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* @return {number}
|
|
94
|
+
*/
|
|
95
|
+
hash(): number;
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
* @param {Tag} other
|
|
99
|
+
* @return {boolean}
|
|
100
|
+
*/
|
|
101
|
+
equals(other: Tag): boolean;
|
|
102
|
+
toJSON(): string[];
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @param {string[]|string} json
|
|
106
|
+
*/
|
|
107
|
+
fromJSON(json: string[] | string): void;
|
|
108
|
+
}
|
|
109
|
+
export namespace Tag {
|
|
110
|
+
let typeName: string;
|
|
111
|
+
}
|
|
112
|
+
export default Tag;
|
|
113
|
+
//# sourceMappingURL=Tag.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/components/Tag.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/components/Tag.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IAsNI;;;;;OAKG;IACH,kBAJW,MAAM,EAAE,gCAEN,MAAM,EAAE,CAsBpB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,GAAG,CAQf;IAGD;;;;OAIG;IACH,4BAFa,GAAG,CAQf;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACL,GAAG,CAUd;IAzRD;;;OAGG;IACH,eAAY;IAEZ;;;OAGG;IACH,oBAEC;IAED;;;;OAIG;IACH,OAHW,MAAM,UAOhB;IAED,cAEC;IAED;;;;OAIG;IACH,oBAFa,OAAO,CAYnB;IAED;;;OAGG;IACH,eAFW,MAAM,EAAE,QAWlB;IAED;;;OAGG;IACH,mBAEC;IAED;;;;OAIG;IACH,yBAFa,OAAO,CAMnB;IAED;;;OAGG;IACH,oBAFW,MAAM,EAAE,WA4BlB;IAED;;;;OAIG;IACH,sBAHW,QAAQ,GACN,OAAO,CAsBnB;IAED;;;OAGG;IACH,aAFa,MAAM,EAAE,CAIpB;IAED;;;;OAIG;IACH,yBAHoB,MAAM,+BAKzB;IAED;;;OAGG;IACH,QAFY,MAAM,CAmBjB;IAED;;;;OAIG;IACH,cAHW,GAAG,GACF,OAAO,CAIlB;IAED,mBAEC;IAED;;;OAGG;IACH,eAFW,MAAM,EAAE,GAAC,MAAM,QAiBzB;CAuEJ;;kBAIS,MAAM"}
|
|
@@ -57,6 +57,8 @@ export class Tag {
|
|
|
57
57
|
* @param {string[]} values
|
|
58
58
|
*/
|
|
59
59
|
addAll(values) {
|
|
60
|
+
assert.isArray(values,'values');
|
|
61
|
+
|
|
60
62
|
const n = values.length;
|
|
61
63
|
for (let i = 0; i < n; i++) {
|
|
62
64
|
const value = values[i];
|
|
@@ -271,6 +273,21 @@ export class Tag {
|
|
|
271
273
|
|
|
272
274
|
return r;
|
|
273
275
|
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Utility constructor
|
|
279
|
+
* @param {string} label
|
|
280
|
+
* @return {Tag}
|
|
281
|
+
*/
|
|
282
|
+
static from(...label){
|
|
283
|
+
|
|
284
|
+
const r = new Tag();
|
|
285
|
+
|
|
286
|
+
r.addAll(label);
|
|
287
|
+
|
|
288
|
+
return r;
|
|
289
|
+
|
|
290
|
+
}
|
|
274
291
|
}
|
|
275
292
|
|
|
276
293
|
/**
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
export class TagSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
2
|
+
klass: typeof Tag;
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {BinaryBuffer} buffer
|
|
6
|
+
* @param {Tag} value
|
|
7
|
+
*/
|
|
8
|
+
serialize(buffer: BinaryBuffer, value: Tag): void;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {BinaryBuffer} buffer
|
|
12
|
+
* @param {Tag} value
|
|
13
|
+
*/
|
|
14
|
+
deserialize(buffer: BinaryBuffer, value: Tag): void;
|
|
2
15
|
}
|
|
3
16
|
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
17
|
+
import Tag from "./Tag.js";
|
|
4
18
|
//# sourceMappingURL=TagSerializationAdapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/components/TagSerializationAdapter.js"],"names":[],"mappings":"AAGA;
|
|
1
|
+
{"version":3,"file":"TagSerializationAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/components/TagSerializationAdapter.js"],"names":[],"mappings":"AAGA;IAEI,kBAAY;IAGZ;;;;OAIG;IACH,uCAFW,GAAG,QAcb;IAED;;;;OAIG;IACH,yCAFW,GAAG,QAYb;CACJ;gDA3C+C,sDAAsD;gBACtF,UAAU"}
|