@dcl/ecs 1.0.0-20220525093820.commit-c20b8cd → 1.0.0-20220601113849.commit-ab0b9fd
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/dist/index.d.ts +1678 -2
- package/dist/index.js +5838 -18
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/package.json +9 -4
- package/dist/built-in-types/ArrayType.d.ts +0 -3
- package/dist/built-in-types/ArrayType.d.ts.map +0 -1
- package/dist/built-in-types/ArrayType.js +0 -23
- package/dist/built-in-types/ArrayType.js.map +0 -1
- package/dist/built-in-types/EcsType.d.ts +0 -6
- package/dist/built-in-types/EcsType.d.ts.map +0 -1
- package/dist/built-in-types/EcsType.js +0 -3
- package/dist/built-in-types/EcsType.js.map +0 -1
- package/dist/built-in-types/MapType.d.ts +0 -10
- package/dist/built-in-types/MapType.d.ts.map +0 -1
- package/dist/built-in-types/MapType.js +0 -24
- package/dist/built-in-types/MapType.js.map +0 -1
- package/dist/built-in-types/Optional.d.ts +0 -3
- package/dist/built-in-types/Optional.d.ts.map +0 -1
- package/dist/built-in-types/Optional.js +0 -24
- package/dist/built-in-types/Optional.js.map +0 -1
- package/dist/built-in-types/basic/Boolean.d.ts +0 -3
- package/dist/built-in-types/basic/Boolean.d.ts.map +0 -1
- package/dist/built-in-types/basic/Boolean.js +0 -12
- package/dist/built-in-types/basic/Boolean.js.map +0 -1
- package/dist/built-in-types/basic/Enum.d.ts +0 -3
- package/dist/built-in-types/basic/Enum.d.ts.map +0 -1
- package/dist/built-in-types/basic/Enum.js +0 -15
- package/dist/built-in-types/basic/Enum.js.map +0 -1
- package/dist/built-in-types/basic/Float.d.ts +0 -4
- package/dist/built-in-types/basic/Float.d.ts.map +0 -1
- package/dist/built-in-types/basic/Float.js +0 -20
- package/dist/built-in-types/basic/Float.js.map +0 -1
- package/dist/built-in-types/basic/Integer.d.ts +0 -6
- package/dist/built-in-types/basic/Integer.d.ts.map +0 -1
- package/dist/built-in-types/basic/Integer.js +0 -44
- package/dist/built-in-types/basic/Integer.js.map +0 -1
- package/dist/built-in-types/basic/String.d.ts +0 -4
- package/dist/built-in-types/basic/String.d.ts.map +0 -1
- package/dist/built-in-types/basic/String.js +0 -13
- package/dist/built-in-types/basic/String.js.map +0 -1
- package/dist/built-in-types/index.d.ts +0 -10
- package/dist/built-in-types/index.d.ts.map +0 -1
- package/dist/built-in-types/index.js +0 -26
- package/dist/built-in-types/index.js.map +0 -1
- package/dist/built-in-types/typing.d.ts +0 -17
- package/dist/built-in-types/typing.d.ts.map +0 -1
- package/dist/built-in-types/typing.js +0 -3
- package/dist/built-in-types/typing.js.map +0 -1
- package/dist/components/definitions/AudioSource.proto +0 -16
- package/dist/components/definitions/AudioStream.proto +0 -13
- package/dist/components/definitions/BoxShape.proto +0 -14
- package/dist/components/definitions/ConeShape.proto +0 -15
- package/dist/components/definitions/CylinderShape.proto +0 -15
- package/dist/components/definitions/PlaneShape.proto +0 -14
- package/dist/components/definitions/README.md +0 -0
- package/dist/components/definitions/SphereShape.proto +0 -13
- package/dist/components/definitions/Transform.md +0 -23
- package/dist/components/generated/AudioSource.d.ts +0 -5
- package/dist/components/generated/AudioSource.d.ts.map +0 -1
- package/dist/components/generated/AudioSource.js +0 -17
- package/dist/components/generated/AudioSource.js.map +0 -1
- package/dist/components/generated/AudioStream.d.ts +0 -5
- package/dist/components/generated/AudioStream.d.ts.map +0 -1
- package/dist/components/generated/AudioStream.js +0 -17
- package/dist/components/generated/AudioStream.js.map +0 -1
- package/dist/components/generated/BoxShape.d.ts +0 -5
- package/dist/components/generated/BoxShape.d.ts.map +0 -1
- package/dist/components/generated/BoxShape.js +0 -17
- package/dist/components/generated/BoxShape.js.map +0 -1
- package/dist/components/generated/ConeShape.d.ts +0 -5
- package/dist/components/generated/ConeShape.d.ts.map +0 -1
- package/dist/components/generated/ConeShape.js +0 -17
- package/dist/components/generated/ConeShape.js.map +0 -1
- package/dist/components/generated/CylinderShape.d.ts +0 -5
- package/dist/components/generated/CylinderShape.d.ts.map +0 -1
- package/dist/components/generated/CylinderShape.js +0 -17
- package/dist/components/generated/CylinderShape.js.map +0 -1
- package/dist/components/generated/PlaneShape.d.ts +0 -5
- package/dist/components/generated/PlaneShape.d.ts.map +0 -1
- package/dist/components/generated/PlaneShape.js +0 -17
- package/dist/components/generated/PlaneShape.js.map +0 -1
- package/dist/components/generated/SphereShape.d.ts +0 -5
- package/dist/components/generated/SphereShape.d.ts.map +0 -1
- package/dist/components/generated/SphereShape.js +0 -17
- package/dist/components/generated/SphereShape.js.map +0 -1
- package/dist/components/generated/index.d.ts +0 -11
- package/dist/components/generated/index.d.ts.map +0 -1
- package/dist/components/generated/index.js +0 -46
- package/dist/components/generated/index.js.map +0 -1
- package/dist/components/generated/pb/AudioSource.d.ts +0 -15
- package/dist/components/generated/pb/AudioSource.d.ts.map +0 -1
- package/dist/components/generated/pb/AudioSource.js +0 -95
- package/dist/components/generated/pb/AudioSource.js.map +0 -1
- package/dist/components/generated/pb/AudioStream.d.ts +0 -12
- package/dist/components/generated/pb/AudioStream.d.ts.map +0 -1
- package/dist/components/generated/pb/AudioStream.js +0 -70
- package/dist/components/generated/pb/AudioStream.js.map +0 -1
- package/dist/components/generated/pb/BoxShape.d.ts +0 -13
- package/dist/components/generated/pb/BoxShape.d.ts.map +0 -1
- package/dist/components/generated/pb/BoxShape.js +0 -91
- package/dist/components/generated/pb/BoxShape.js.map +0 -1
- package/dist/components/generated/pb/ConeShape.d.ts +0 -14
- package/dist/components/generated/pb/ConeShape.d.ts.map +0 -1
- package/dist/components/generated/pb/ConeShape.js +0 -88
- package/dist/components/generated/pb/ConeShape.js.map +0 -1
- package/dist/components/generated/pb/CylinderShape.d.ts +0 -14
- package/dist/components/generated/pb/CylinderShape.d.ts.map +0 -1
- package/dist/components/generated/pb/CylinderShape.js +0 -88
- package/dist/components/generated/pb/CylinderShape.js.map +0 -1
- package/dist/components/generated/pb/PlaneShape.d.ts +0 -13
- package/dist/components/generated/pb/PlaneShape.d.ts.map +0 -1
- package/dist/components/generated/pb/PlaneShape.js +0 -91
- package/dist/components/generated/pb/PlaneShape.js.map +0 -1
- package/dist/components/generated/pb/SphereShape.d.ts +0 -12
- package/dist/components/generated/pb/SphereShape.d.ts.map +0 -1
- package/dist/components/generated/pb/SphereShape.js +0 -70
- package/dist/components/generated/pb/SphereShape.js.map +0 -1
- package/dist/components/index.d.ts +0 -18
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -26
- package/dist/components/index.js.map +0 -1
- package/dist/components/legacy/Transform.d.ts +0 -13
- package/dist/components/legacy/Transform.d.ts.map +0 -1
- package/dist/components/legacy/Transform.js +0 -32
- package/dist/components/legacy/Transform.js.map +0 -1
- package/dist/components/legacy/index.d.ts +0 -17
- package/dist/components/legacy/index.d.ts.map +0 -1
- package/dist/components/legacy/index.js +0 -14
- package/dist/components/legacy/index.js.map +0 -1
- package/dist/components/legacy/types.d.ts +0 -52
- package/dist/components/legacy/types.d.ts.map +0 -1
- package/dist/components/legacy/types.js +0 -57
- package/dist/components/legacy/types.js.map +0 -1
- package/dist/components/types.d.ts +0 -4
- package/dist/components/types.d.ts.map +0 -1
- package/dist/components/types.js +0 -8
- package/dist/components/types.js.map +0 -1
- package/dist/ecs.api.json +0 -204
- package/dist/engine/component.d.ts +0 -26
- package/dist/engine/component.d.ts.map +0 -1
- package/dist/engine/component.js +0 -103
- package/dist/engine/component.js.map +0 -1
- package/dist/engine/entity-utils.d.ts +0 -8
- package/dist/engine/entity-utils.d.ts.map +0 -1
- package/dist/engine/entity-utils.js +0 -22
- package/dist/engine/entity-utils.js.map +0 -1
- package/dist/engine/entity.d.ts +0 -18
- package/dist/engine/entity.d.ts.map +0 -1
- package/dist/engine/entity.js +0 -80
- package/dist/engine/entity.js.map +0 -1
- package/dist/engine/index.d.ts +0 -28
- package/dist/engine/index.d.ts.map +0 -1
- package/dist/engine/index.js +0 -136
- package/dist/engine/index.js.map +0 -1
- package/dist/engine/types.d.ts +0 -28
- package/dist/engine/types.d.ts.map +0 -1
- package/dist/engine/types.js +0 -3
- package/dist/engine/types.js.map +0 -1
- package/dist/engine/utils.d.ts +0 -4
- package/dist/engine/utils.d.ts.map +0 -1
- package/dist/engine/utils.js +0 -17
- package/dist/engine/utils.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/serialization/ByteBuffer/index.d.ts +0 -128
- package/dist/serialization/ByteBuffer/index.d.ts.map +0 -1
- package/dist/serialization/ByteBuffer/index.js +0 -286
- package/dist/serialization/ByteBuffer/index.js.map +0 -1
- package/dist/serialization/crdt/componentOperation.d.ts +0 -26
- package/dist/serialization/crdt/componentOperation.d.ts.map +0 -1
- package/dist/serialization/crdt/componentOperation.js +0 -46
- package/dist/serialization/crdt/componentOperation.js.map +0 -1
- package/dist/serialization/wireMessage.d.ts +0 -40
- package/dist/serialization/wireMessage.d.ts.map +0 -1
- package/dist/serialization/wireMessage.js +0 -57
- package/dist/serialization/wireMessage.js.map +0 -1
- package/dist/systems/crdt/index.d.ts +0 -7
- package/dist/systems/crdt/index.d.ts.map +0 -1
- package/dist/systems/crdt/index.js +0 -155
- package/dist/systems/crdt/index.js.map +0 -1
- package/dist/systems/crdt/transport.d.ts +0 -9
- package/dist/systems/crdt/transport.d.ts.map +0 -1
- package/dist/systems/crdt/transport.js +0 -26
- package/dist/systems/crdt/transport.js.map +0 -1
- package/dist/systems/crdt/types.d.ts +0 -11
- package/dist/systems/crdt/types.d.ts.map +0 -1
- package/dist/systems/crdt/types.js +0 -3
- package/dist/systems/crdt/types.js.map +0 -1
- package/dist/systems/crdt/utils.d.ts +0 -12
- package/dist/systems/crdt/utils.d.ts.map +0 -1
- package/dist/systems/crdt/utils.js +0 -55
- package/dist/systems/crdt/utils.js.map +0 -1
- package/dist/tsdoc-metadata.json +0 -11
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LEGACY_COMPONENT_ID = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
var LEGACY_COMPONENT_ID;
|
|
8
|
-
(function (LEGACY_COMPONENT_ID) {
|
|
9
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["TRANSFORM"] = 1] = "TRANSFORM";
|
|
10
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UUID_CALLBACK"] = 8] = "UUID_CALLBACK";
|
|
11
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["BOX_SHAPE"] = 16] = "BOX_SHAPE";
|
|
12
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["SPHERE_SHAPE"] = 17] = "SPHERE_SHAPE";
|
|
13
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["PLANE_SHAPE"] = 18] = "PLANE_SHAPE";
|
|
14
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["CONE_SHAPE"] = 19] = "CONE_SHAPE";
|
|
15
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["CYLINDER_SHAPE"] = 20] = "CYLINDER_SHAPE";
|
|
16
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["TEXT_SHAPE"] = 21] = "TEXT_SHAPE";
|
|
17
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["NFT_SHAPE"] = 22] = "NFT_SHAPE";
|
|
18
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_WORLD_SPACE_SHAPE"] = 23] = "UI_WORLD_SPACE_SHAPE";
|
|
19
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_SCREEN_SPACE_SHAPE"] = 24] = "UI_SCREEN_SPACE_SHAPE";
|
|
20
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_CONTAINER_RECT"] = 25] = "UI_CONTAINER_RECT";
|
|
21
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_CONTAINER_STACK"] = 26] = "UI_CONTAINER_STACK";
|
|
22
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_TEXT_SHAPE"] = 27] = "UI_TEXT_SHAPE";
|
|
23
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_INPUT_TEXT_SHAPE"] = 28] = "UI_INPUT_TEXT_SHAPE";
|
|
24
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_IMAGE_SHAPE"] = 29] = "UI_IMAGE_SHAPE";
|
|
25
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_SLIDER_SHAPE"] = 30] = "UI_SLIDER_SHAPE";
|
|
26
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["CIRCLE_SHAPE"] = 31] = "CIRCLE_SHAPE";
|
|
27
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["BILLBOARD"] = 32] = "BILLBOARD";
|
|
28
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["ANIMATION"] = 33] = "ANIMATION";
|
|
29
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["FONT"] = 34] = "FONT";
|
|
30
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_FULLSCREEN_SHAPE"] = 40] = "UI_FULLSCREEN_SHAPE";
|
|
31
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_BUTTON_SHAPE"] = 41] = "UI_BUTTON_SHAPE";
|
|
32
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["GLTF_SHAPE"] = 54] = "GLTF_SHAPE";
|
|
33
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["OBJ_SHAPE"] = 55] = "OBJ_SHAPE";
|
|
34
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AVATAR_SHAPE"] = 56] = "AVATAR_SHAPE";
|
|
35
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["BASIC_MATERIAL"] = 64] = "BASIC_MATERIAL";
|
|
36
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["PBR_MATERIAL"] = 65] = "PBR_MATERIAL";
|
|
37
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["HIGHLIGHT_ENTITY"] = 66] = "HIGHLIGHT_ENTITY";
|
|
38
|
-
/** @deprecated Sound has been deprecataed */
|
|
39
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["SOUND"] = 67] = "SOUND";
|
|
40
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["TEXTURE"] = 68] = "TEXTURE";
|
|
41
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["VIDEO_CLIP"] = 70] = "VIDEO_CLIP";
|
|
42
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["VIDEO_TEXTURE"] = 71] = "VIDEO_TEXTURE";
|
|
43
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AVATAR_TEXTURE"] = 72] = "AVATAR_TEXTURE";
|
|
44
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AUDIO_CLIP"] = 200] = "AUDIO_CLIP";
|
|
45
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AUDIO_SOURCE"] = 201] = "AUDIO_SOURCE";
|
|
46
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AUDIO_STREAM"] = 202] = "AUDIO_STREAM";
|
|
47
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["GIZMOS"] = 203] = "GIZMOS";
|
|
48
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["SMART_ITEM"] = 204] = "SMART_ITEM";
|
|
49
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AVATAR_MODIFIER_AREA"] = 205] = "AVATAR_MODIFIER_AREA";
|
|
50
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AVATAR_ATTACH"] = 206] = "AVATAR_ATTACH";
|
|
51
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["CAMERA_MODE_AREA"] = 207] = "CAMERA_MODE_AREA";
|
|
52
|
-
// For state sync only
|
|
53
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["NAME"] = 300] = "NAME";
|
|
54
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["LOCKED_ON_EDIT"] = 301] = "LOCKED_ON_EDIT";
|
|
55
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["VISIBLE_ON_EDIT"] = 302] = "VISIBLE_ON_EDIT";
|
|
56
|
-
})(LEGACY_COMPONENT_ID = exports.LEGACY_COMPONENT_ID || (exports.LEGACY_COMPONENT_ID = {}));
|
|
57
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/legacy/types.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,mBA2DX;AA3DD,WAAY,mBAAmB;IAC7B,uEAAa,CAAA;IACb,+EAAiB,CAAA;IACjB,wEAAc,CAAA;IACd,8EAAiB,CAAA;IACjB,4EAAgB,CAAA;IAChB,0EAAe,CAAA;IACf,kFAAmB,CAAA;IACnB,0EAAe,CAAA;IAEf,wEAAc,CAAA;IACd,8FAAyB,CAAA;IACzB,gGAA0B,CAAA;IAC1B,wFAAsB,CAAA;IACtB,0FAAuB,CAAA;IACvB,gFAAkB,CAAA;IAClB,4FAAwB,CAAA;IACxB,kFAAmB,CAAA;IACnB,oFAAoB,CAAA;IACpB,8EAAiB,CAAA;IACjB,wEAAc,CAAA;IAEd,wEAAc,CAAA;IACd,8DAAS,CAAA;IAET,4FAAwB,CAAA;IACxB,oFAAoB,CAAA;IAEpB,0EAAe,CAAA;IACf,wEAAc,CAAA;IACd,8EAAiB,CAAA;IAEjB,kFAAmB,CAAA;IACnB,8EAAiB,CAAA;IAEjB,sFAAqB,CAAA;IAErB,6CAA6C;IAC7C,gEAAU,CAAA;IACV,oEAAY,CAAA;IAEZ,0EAAe,CAAA;IACf,gFAAkB,CAAA;IAElB,kFAAmB,CAAA;IAEnB,2EAAgB,CAAA;IAChB,+EAAkB,CAAA;IAClB,+EAAkB,CAAA;IAClB,mEAAY,CAAA;IACZ,2EAAgB,CAAA;IAChB,+FAA0B,CAAA;IAC1B,iFAAmB,CAAA;IACnB,uFAAsB,CAAA;IAEtB,sBAAsB;IACtB,+DAAU,CAAA;IACV,mFAAoB,CAAA;IACpB,qFAAqB,CAAA;AACvB,CAAC,EA3DW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QA2D9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACtB,IAAI,OAAO;CACZ"}
|
package/dist/components/types.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COMPONENT_ID = void 0;
|
|
4
|
-
var COMPONENT_ID;
|
|
5
|
-
(function (COMPONENT_ID) {
|
|
6
|
-
COMPONENT_ID[COMPONENT_ID["SYNC"] = 1000] = "SYNC";
|
|
7
|
-
})(COMPONENT_ID = exports.COMPONENT_ID || (exports.COMPONENT_ID = {}));
|
|
8
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAEX;AAFD,WAAY,YAAY;IACtB,kDAAW,CAAA;AACb,CAAC,EAFW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAEvB"}
|
package/dist/ecs.api.json
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"metadata": {
|
|
3
|
-
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
-
"toolVersion": "7.23.1",
|
|
5
|
-
"schemaVersion": 1005,
|
|
6
|
-
"oldestForwardsCompatibleVersion": 1001,
|
|
7
|
-
"tsdocConfig": {
|
|
8
|
-
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
|
|
9
|
-
"noStandardTags": true,
|
|
10
|
-
"tagDefinitions": [
|
|
11
|
-
{
|
|
12
|
-
"tagName": "@alpha",
|
|
13
|
-
"syntaxKind": "modifier"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"tagName": "@beta",
|
|
17
|
-
"syntaxKind": "modifier"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"tagName": "@defaultValue",
|
|
21
|
-
"syntaxKind": "block"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"tagName": "@decorator",
|
|
25
|
-
"syntaxKind": "block",
|
|
26
|
-
"allowMultiple": true
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"tagName": "@deprecated",
|
|
30
|
-
"syntaxKind": "block"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"tagName": "@eventProperty",
|
|
34
|
-
"syntaxKind": "modifier"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"tagName": "@example",
|
|
38
|
-
"syntaxKind": "block",
|
|
39
|
-
"allowMultiple": true
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"tagName": "@experimental",
|
|
43
|
-
"syntaxKind": "modifier"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"tagName": "@inheritDoc",
|
|
47
|
-
"syntaxKind": "inline"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"tagName": "@internal",
|
|
51
|
-
"syntaxKind": "modifier"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"tagName": "@label",
|
|
55
|
-
"syntaxKind": "inline"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"tagName": "@link",
|
|
59
|
-
"syntaxKind": "inline",
|
|
60
|
-
"allowMultiple": true
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"tagName": "@override",
|
|
64
|
-
"syntaxKind": "modifier"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"tagName": "@packageDocumentation",
|
|
68
|
-
"syntaxKind": "modifier"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"tagName": "@param",
|
|
72
|
-
"syntaxKind": "block",
|
|
73
|
-
"allowMultiple": true
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"tagName": "@privateRemarks",
|
|
77
|
-
"syntaxKind": "block"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"tagName": "@public",
|
|
81
|
-
"syntaxKind": "modifier"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"tagName": "@readonly",
|
|
85
|
-
"syntaxKind": "modifier"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"tagName": "@remarks",
|
|
89
|
-
"syntaxKind": "block"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"tagName": "@returns",
|
|
93
|
-
"syntaxKind": "block"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"tagName": "@sealed",
|
|
97
|
-
"syntaxKind": "modifier"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"tagName": "@see",
|
|
101
|
-
"syntaxKind": "block"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"tagName": "@throws",
|
|
105
|
-
"syntaxKind": "block",
|
|
106
|
-
"allowMultiple": true
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"tagName": "@typeParam",
|
|
110
|
-
"syntaxKind": "block",
|
|
111
|
-
"allowMultiple": true
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"tagName": "@virtual",
|
|
115
|
-
"syntaxKind": "modifier"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"tagName": "@betaDocumentation",
|
|
119
|
-
"syntaxKind": "modifier"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"tagName": "@internalRemarks",
|
|
123
|
-
"syntaxKind": "block"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"tagName": "@preapproved",
|
|
127
|
-
"syntaxKind": "modifier"
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
"supportForTags": {
|
|
131
|
-
"@alpha": true,
|
|
132
|
-
"@beta": true,
|
|
133
|
-
"@defaultValue": true,
|
|
134
|
-
"@decorator": true,
|
|
135
|
-
"@deprecated": true,
|
|
136
|
-
"@eventProperty": true,
|
|
137
|
-
"@example": true,
|
|
138
|
-
"@experimental": true,
|
|
139
|
-
"@inheritDoc": true,
|
|
140
|
-
"@internal": true,
|
|
141
|
-
"@label": true,
|
|
142
|
-
"@link": true,
|
|
143
|
-
"@override": true,
|
|
144
|
-
"@packageDocumentation": true,
|
|
145
|
-
"@param": true,
|
|
146
|
-
"@privateRemarks": true,
|
|
147
|
-
"@public": true,
|
|
148
|
-
"@readonly": true,
|
|
149
|
-
"@remarks": true,
|
|
150
|
-
"@returns": true,
|
|
151
|
-
"@sealed": true,
|
|
152
|
-
"@see": true,
|
|
153
|
-
"@throws": true,
|
|
154
|
-
"@typeParam": true,
|
|
155
|
-
"@virtual": true,
|
|
156
|
-
"@betaDocumentation": true,
|
|
157
|
-
"@internalRemarks": true,
|
|
158
|
-
"@preapproved": true
|
|
159
|
-
},
|
|
160
|
-
"reportUnsupportedHtmlElements": false
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
"kind": "Package",
|
|
164
|
-
"canonicalReference": "@dcl/ecs!",
|
|
165
|
-
"docComment": "",
|
|
166
|
-
"name": "@dcl/ecs",
|
|
167
|
-
"members": [
|
|
168
|
-
{
|
|
169
|
-
"kind": "EntryPoint",
|
|
170
|
-
"canonicalReference": "@dcl/ecs!",
|
|
171
|
-
"name": "",
|
|
172
|
-
"members": [
|
|
173
|
-
{
|
|
174
|
-
"kind": "Function",
|
|
175
|
-
"canonicalReference": "@dcl/ecs!Engine:function(1)",
|
|
176
|
-
"docComment": "/**\n * @public\n */\n",
|
|
177
|
-
"excerptTokens": [
|
|
178
|
-
{
|
|
179
|
-
"kind": "Content",
|
|
180
|
-
"text": "export declare function Engine(): "
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"kind": "Reference",
|
|
184
|
-
"text": "IEngine",
|
|
185
|
-
"canonicalReference": "@dcl/ecs!IEngine:type"
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
"kind": "Content",
|
|
189
|
-
"text": ";"
|
|
190
|
-
}
|
|
191
|
-
],
|
|
192
|
-
"returnTypeTokenRange": {
|
|
193
|
-
"startIndex": 1,
|
|
194
|
-
"endIndex": 2
|
|
195
|
-
},
|
|
196
|
-
"releaseTag": "Public",
|
|
197
|
-
"overloadIndex": 1,
|
|
198
|
-
"parameters": [],
|
|
199
|
-
"name": "Engine"
|
|
200
|
-
}
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
]
|
|
204
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { EcsType } from '../built-in-types';
|
|
2
|
-
import { ByteBuffer } from '../serialization/ByteBuffer';
|
|
3
|
-
import { Entity } from './entity';
|
|
4
|
-
import { DeepReadonly } from './types';
|
|
5
|
-
export declare type EcsResult<T extends EcsType> = T extends EcsType ? ReturnType<T['deserialize']> : never;
|
|
6
|
-
export declare type ComponentType<T extends EcsType> = EcsResult<T>;
|
|
7
|
-
export declare type ComponentDefinition<T extends EcsType = EcsType<any>> = {
|
|
8
|
-
_id: number;
|
|
9
|
-
has(entity: Entity): boolean;
|
|
10
|
-
getFrom(entity: Entity): DeepReadonly<ComponentType<T>>;
|
|
11
|
-
getOrNull(entity: Entity): DeepReadonly<ComponentType<T>> | null;
|
|
12
|
-
create(entity: Entity, val: ComponentType<T>): ComponentType<T>;
|
|
13
|
-
mutable(entity: Entity): ComponentType<T>;
|
|
14
|
-
createOrReplace(entity: Entity, val: ComponentType<T>): ComponentType<T>;
|
|
15
|
-
deleteFrom(entity: Entity): ComponentType<T> | null;
|
|
16
|
-
upsertFromBinary(entity: Entity, data: ByteBuffer): ComponentType<T> | null;
|
|
17
|
-
updateFromBinary(entity: Entity, data: ByteBuffer): ComponentType<T> | null;
|
|
18
|
-
toBinary(entity: Entity): ByteBuffer;
|
|
19
|
-
writeToByteBuffer(entity: Entity, buffer: ByteBuffer): void;
|
|
20
|
-
iterator(): Iterable<[Entity, ComponentType<T>]>;
|
|
21
|
-
dirtyIterator(): Iterable<Entity>;
|
|
22
|
-
clearDirty(): void;
|
|
23
|
-
isDirty(entity: Entity): boolean;
|
|
24
|
-
};
|
|
25
|
-
export declare function defineComponent<T extends EcsType>(componentId: number, spec: T): ComponentDefinition<T>;
|
|
26
|
-
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/engine/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAoB,MAAM,6BAA6B,CAAA;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,oBAAY,SAAS,CAAC,CAAC,SAAS,OAAO,IAAI,CAAC,SAAS,OAAO,GACxD,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,GAC5B,KAAK,CAAA;AAET,oBAAY,aAAa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AC,CAAC,CAAC,CAAC,CAAC,CAAA;IAGhD,aAAa,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAA;IACjC,UAAU,IAAI,IAAI,CAAA;IAClB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;CACjC,CAAA;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,OAAO,EAC/C,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,CAAC,GAEN,mBAAmB,CAAC,CAAC,CAAC,CAwHxB"}
|
package/dist/engine/component.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defineComponent = void 0;
|
|
4
|
-
const ByteBuffer_1 = require("../serialization/ByteBuffer");
|
|
5
|
-
const utils_1 = require("./utils");
|
|
6
|
-
function defineComponent(componentId, spec
|
|
7
|
-
// meta: { syncFlags }
|
|
8
|
-
) {
|
|
9
|
-
const data = new Map();
|
|
10
|
-
const dirtyIterator = new Set();
|
|
11
|
-
return {
|
|
12
|
-
_id: componentId,
|
|
13
|
-
isDirty: function (entity) {
|
|
14
|
-
return dirtyIterator.has(entity);
|
|
15
|
-
},
|
|
16
|
-
has: function (entity) {
|
|
17
|
-
return data.has(entity);
|
|
18
|
-
},
|
|
19
|
-
deleteFrom: function (entity) {
|
|
20
|
-
const component = data.get(entity);
|
|
21
|
-
data.delete(entity);
|
|
22
|
-
dirtyIterator.add(entity);
|
|
23
|
-
return component || null;
|
|
24
|
-
},
|
|
25
|
-
getOrNull: function (entity) {
|
|
26
|
-
const component = data.get(entity);
|
|
27
|
-
return component ? (0, utils_1.deepReadonly)(component) : null;
|
|
28
|
-
},
|
|
29
|
-
getFrom: function (entity) {
|
|
30
|
-
const component = data.get(entity);
|
|
31
|
-
if (!component) {
|
|
32
|
-
throw new Error(`[getFrom] Component ${componentId} for ${entity} not found`);
|
|
33
|
-
}
|
|
34
|
-
return (0, utils_1.deepReadonly)(component);
|
|
35
|
-
},
|
|
36
|
-
create: function (entity, value) {
|
|
37
|
-
const component = data.get(entity);
|
|
38
|
-
if (component) {
|
|
39
|
-
throw new Error(`[create] Component ${componentId} for ${entity} already exists`);
|
|
40
|
-
}
|
|
41
|
-
data.set(entity, value);
|
|
42
|
-
dirtyIterator.add(entity);
|
|
43
|
-
return value;
|
|
44
|
-
},
|
|
45
|
-
createOrReplace: function (entity, value) {
|
|
46
|
-
data.set(entity, value);
|
|
47
|
-
dirtyIterator.add(entity);
|
|
48
|
-
return value;
|
|
49
|
-
},
|
|
50
|
-
mutable: function (entity) {
|
|
51
|
-
const component = data.get(entity);
|
|
52
|
-
if (!component) {
|
|
53
|
-
throw new Error(`[mutable] Component ${componentId} for ${entity} not found`);
|
|
54
|
-
}
|
|
55
|
-
dirtyIterator.add(entity);
|
|
56
|
-
return component;
|
|
57
|
-
},
|
|
58
|
-
iterator: function* () {
|
|
59
|
-
for (const [entity, component] of data) {
|
|
60
|
-
yield [entity, component];
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
dirtyIterator: function* () {
|
|
64
|
-
for (const entity of dirtyIterator) {
|
|
65
|
-
yield entity;
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
toBinary(entity) {
|
|
69
|
-
const component = data.get(entity);
|
|
70
|
-
if (!component) {
|
|
71
|
-
throw new Error(`Component ${componentId} for ${entity} not found`);
|
|
72
|
-
}
|
|
73
|
-
const writeBuffer = (0, ByteBuffer_1.createByteBuffer)();
|
|
74
|
-
spec.serialize(component, writeBuffer);
|
|
75
|
-
return writeBuffer;
|
|
76
|
-
},
|
|
77
|
-
writeToByteBuffer(entity, buffer) {
|
|
78
|
-
const component = data.get(entity);
|
|
79
|
-
if (!component) {
|
|
80
|
-
throw new Error(`[toBinary] Component ${componentId} for ${entity} not found`);
|
|
81
|
-
}
|
|
82
|
-
spec.serialize(component, buffer);
|
|
83
|
-
},
|
|
84
|
-
updateFromBinary(entity, buffer) {
|
|
85
|
-
const component = data.get(entity);
|
|
86
|
-
if (!component) {
|
|
87
|
-
throw new Error(`[updateFromBinary] Component ${componentId} for ${entity} not found`);
|
|
88
|
-
}
|
|
89
|
-
return this.upsertFromBinary(entity, buffer);
|
|
90
|
-
},
|
|
91
|
-
upsertFromBinary(entity, buffer) {
|
|
92
|
-
const newValue = spec.deserialize(buffer);
|
|
93
|
-
data.set(entity, newValue);
|
|
94
|
-
dirtyIterator.add(entity);
|
|
95
|
-
return newValue;
|
|
96
|
-
},
|
|
97
|
-
clearDirty: function () {
|
|
98
|
-
dirtyIterator.clear();
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
exports.defineComponent = defineComponent;
|
|
103
|
-
//# sourceMappingURL=component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/engine/component.ts"],"names":[],"mappings":";;;AACA,4DAA0E;AAE1E,mCAAsC;AAuCtC,SAAgB,eAAe,CAC7B,WAAmB,EACnB,IAAO;AACP,sBAAsB;;IAEtB,MAAM,IAAI,GAAG,IAAI,GAAG,EAA4B,CAAA;IAChD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAA;IAEvC,OAAO;QACL,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE,UAAU,MAAc;YAC/B,OAAO,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAClC,CAAC;QACD,GAAG,EAAE,UAAU,MAAc;YAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACzB,CAAC;QACD,UAAU,EAAE,UAAU,MAAc;YAClC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAClC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YACnB,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YACzB,OAAO,SAAS,IAAI,IAAI,CAAA;QAC1B,CA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AM,EAAE,MAAM,CAAC,CAAA;QAC9C,CAAC;QACD,gBAAgB,CACd,MAAc,EACd,MAAkB;YAElB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;YACzC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;YAC1B,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YACzB,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,UAAU,EAAE;YACV,aAAa,CAAC,KAAK,EAAE,CAAA;QACvB,CAAC;KACF,CAAA;AACH,CAAC;AA5HD,0CA4HC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Entity } from './entity';
|
|
2
|
-
export declare namespace EntityUtils {
|
|
3
|
-
const MAX_ENTITIES = 10000;
|
|
4
|
-
function getOffset(): number;
|
|
5
|
-
function isStaticEntity(entity: Entity): boolean;
|
|
6
|
-
}
|
|
7
|
-
export default EntityUtils;
|
|
8
|
-
//# sourceMappingURL=entity-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-utils.d.ts","sourceRoot":"","sources":["../../src/engine/entity-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,yBAAiB,WAAW,CAAC;IACpB,MAAM,YAAY,QAAQ,CAAA;IAGjC,SAAgB,SAAS,WAIxB;IAGD,SAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,WAG5C;CACF;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityUtils = void 0;
|
|
4
|
-
var EntityUtils;
|
|
5
|
-
(function (EntityUtils) {
|
|
6
|
-
EntityUtils.MAX_ENTITIES = 10000;
|
|
7
|
-
let offset = EntityUtils.MAX_ENTITIES;
|
|
8
|
-
function getOffset() {
|
|
9
|
-
const off = offset + 1;
|
|
10
|
-
offset += EntityUtils.MAX_ENTITIES;
|
|
11
|
-
return off;
|
|
12
|
-
}
|
|
13
|
-
EntityUtils.getOffset = getOffset;
|
|
14
|
-
const STATIC_ENTITIES = [0, EntityUtils.MAX_ENTITIES];
|
|
15
|
-
function isStaticEntity(entity) {
|
|
16
|
-
const [min, max] = STATIC_ENTITIES;
|
|
17
|
-
return entity >= min && entity <= max;
|
|
18
|
-
}
|
|
19
|
-
EntityUtils.isStaticEntity = isStaticEntity;
|
|
20
|
-
})(EntityUtils = exports.EntityUtils || (exports.EntityUtils = {}));
|
|
21
|
-
exports.default = EntityUtils;
|
|
22
|
-
//# sourceMappingURL=entity-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-utils.js","sourceRoot":"","sources":["../../src/engine/entity-utils.ts"],"names":[],"mappings":";;;AAEA,IAAiB,WAAW,CAe3B;AAfD,WAAiB,WAAW;IACb,wBAAY,GAAG,KAAK,CAAA;IAEjC,IAAI,MAAM,GAAW,YAAA,YAAY,CAAA;IACjC,SAAgB,SAAS;QACvB,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,CAAA;QACtB,MAAM,IAAI,YAAA,YAAY,CAAA;QACtB,OAAO,GAAG,CAAA;IACZ,CAAC;IAJe,qBAAS,YAIxB,CAAA;IAED,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,YAAA,YAAY,CAAC,CAAA;IACzC,SAAgB,cAAc,CAAC,MAAc;QAC3C,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,eAAe,CAAA;QAClC,OAAO,MAAM,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,CAAA;IACvC,CAAC;IAHe,0BAAc,iBAG7B,CAAA;AACH,CAAC,EAfgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAe3B;AAED,kBAAe,WAAW,CAAA"}
|
package/dist/engine/entity.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
declare const entitySymbol: unique symbol;
|
|
2
|
-
export declare type Entity = number & {
|
|
3
|
-
[entitySymbol]: true;
|
|
4
|
-
};
|
|
5
|
-
export declare function EntityContainer(): {
|
|
6
|
-
generateEntity(dynamic?: boolean): Entity;
|
|
7
|
-
removeEntity(entity: Entity): void;
|
|
8
|
-
getUnusedEntities(): Set<Entity>;
|
|
9
|
-
getUsedEntities(): Set<Entity>;
|
|
10
|
-
};
|
|
11
|
-
declare function Entity(withOffset?: boolean): {
|
|
12
|
-
getUnusedEntities(): Set<Entity>;
|
|
13
|
-
getUsedEntities(): Set<Entity>;
|
|
14
|
-
generateEntity: () => Entity;
|
|
15
|
-
removeEntity: (entity: Entity) => void;
|
|
16
|
-
};
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/engine/entity.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,YAAY,EAAE,OAAO,MAAM,CAAA;AACzC,oBAAY,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,YAAY,CAAC,EAAE,IAAI,CAAA;CAAE,CAAA;AAEtD,wBAAgB,eAAe;6BAIH,OAAO,GAAW,MAAM;yBAI3B,MAAM,GAAG,IAAI;yBAIb,IAAI,MAAM,CAAC;uBAMb,IAAI,MAAM,CAAC;EAOjC;AAED,iBAAS,MAAM,CAAC,UAAU,GAAE,OAAe;;;0BAUd,MAAM;2BA0BH,MAAM;EAgBrC"}
|
package/dist/engine/entity.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityContainer = void 0;
|
|
4
|
-
const entity_utils_1 = require("./entity-utils");
|
|
5
|
-
function EntityContainer() {
|
|
6
|
-
const staticEntity = Entity();
|
|
7
|
-
const dynamicEntity = Entity(true);
|
|
8
|
-
return {
|
|
9
|
-
generateEntity(dynamic = false) {
|
|
10
|
-
if (dynamic)
|
|
11
|
-
return dynamicEntity.generateEntity();
|
|
12
|
-
return staticEntity.generateEntity();
|
|
13
|
-
},
|
|
14
|
-
removeEntity(entity) {
|
|
15
|
-
staticEntity.removeEntity(entity);
|
|
16
|
-
dynamicEntity.removeEntity(entity);
|
|
17
|
-
},
|
|
18
|
-
getUnusedEntities() {
|
|
19
|
-
return new Set([
|
|
20
|
-
...staticEntity.getUnusedEntities(),
|
|
21
|
-
...dynamicEntity.getUnusedEntities()
|
|
22
|
-
]);
|
|
23
|
-
},
|
|
24
|
-
getUsedEntities() {
|
|
25
|
-
return new Set([
|
|
26
|
-
...staticEntity.getUsedEntities(),
|
|
27
|
-
...dynamicEntity.getUsedEntities()
|
|
28
|
-
]);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.EntityContainer = EntityContainer;
|
|
33
|
-
function Entity(withOffset = false) {
|
|
34
|
-
function createEntity(entity) {
|
|
35
|
-
return entity;
|
|
36
|
-
}
|
|
37
|
-
// TODO: getoffset from a server?
|
|
38
|
-
const offset = withOffset ? entity_utils_1.EntityUtils.getOffset() : 0;
|
|
39
|
-
const usedEntities = new Set();
|
|
40
|
-
const unusedEntities = new Set();
|
|
41
|
-
function generateEntity() {
|
|
42
|
-
if (!unusedEntities.size && !usedEntities.size) {
|
|
43
|
-
const entity = createEntity(offset);
|
|
44
|
-
usedEntities.add(entity);
|
|
45
|
-
return entity;
|
|
46
|
-
}
|
|
47
|
-
// TODO: what happens if we delete an entity
|
|
48
|
-
// and creates a new one in the same tick
|
|
49
|
-
const iterator = unusedEntities[Symbol.iterator]().next();
|
|
50
|
-
if (iterator.done) {
|
|
51
|
-
const entity = createEntity(Math.max(...usedEntities.values()) + 1);
|
|
52
|
-
if (entity >= entity_utils_1.EntityUtils.MAX_ENTITIES + offset) {
|
|
53
|
-
throw new Error('Entity rate limit exceed');
|
|
54
|
-
}
|
|
55
|
-
usedEntities.add(entity);
|
|
56
|
-
return entity;
|
|
57
|
-
}
|
|
58
|
-
const entity = iterator.value;
|
|
59
|
-
unusedEntities.delete(entity);
|
|
60
|
-
usedEntities.add(entity);
|
|
61
|
-
return entity;
|
|
62
|
-
}
|
|
63
|
-
function removeEntity(entity) {
|
|
64
|
-
if (!usedEntities.has(entity))
|
|
65
|
-
return;
|
|
66
|
-
usedEntities.delete(entity);
|
|
67
|
-
unusedEntities.add(entity);
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
getUnusedEntities() {
|
|
71
|
-
return new Set(unusedEntities);
|
|
72
|
-
},
|
|
73
|
-
getUsedEntities() {
|
|
74
|
-
return new Set(usedEntities);
|
|
75
|
-
},
|
|
76
|
-
generateEntity,
|
|
77
|
-
removeEntity
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=entity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../src/engine/entity.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAK5C,SAAgB,eAAe;IAC7B,MAAM,YAAY,GAAG,MAAM,EAAE,CAAA;IAC7B,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;IAClC,OAAO;QACL,cAAc,CAAC,UAAmB,KAAK;YACrC,IAAI,OAAO;gBAAE,OAAO,aAAa,CAAC,cAAc,EAAE,CAAA;YAClD,OAAO,YAAY,CAAC,cAAc,EAAE,CAAA;QACtC,CAAC;QACD,YAAY,CAAC,MAAc;YACzB,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;YACjC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;QACpC,CAAC;QACD,iBAAiB;YACf,OAAO,IAAI,GAAG,CAAC;gBACb,GAAG,YAAY,CAAC,iBAAiB,EAAE;gBACnC,GAAG,aAAa,CAAC,iBAAiB,E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ACd;QAED,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAA;QAC7B,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAC7B,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAExB,OAAO,MAAM,CAAA;IACf,CAAC;IAED,SAAS,YAAY,CAAC,MAAc;QAClC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,OAAM;QACrC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAC3B,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC;IAED,OAAO;QACL,iBAAiB;YACf,OAAO,IAAI,GAAG,CAAC,cAAc,CAAC,CAAA;QAChC,CAAC;QACD,eAAe;YACb,OAAO,IAAI,GAAG,CAAC,YAAY,CAAC,CAAA;QAC9B,CAAC;QACD,cAAc;QACd,YAAY;KACb,CAAA;AACH,CAAC"}
|
package/dist/engine/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Entity } from './entity';
|
|
2
|
-
import { ComponentDefinition } from './component';
|
|
3
|
-
import { ComponentEcsType, Update, DeepReadonly } from './types';
|
|
4
|
-
import { EcsType } from '../built-in-types';
|
|
5
|
-
import { IEngine } from './types';
|
|
6
|
-
declare function preEngine(): {
|
|
7
|
-
entitiesComponent: Map<number, Set<number>>;
|
|
8
|
-
componentsDefinition: Map<number, ComponentDefinition<any>>;
|
|
9
|
-
systems: Set<Update>;
|
|
10
|
-
addEntity: (dynamic?: boolean) => Entity;
|
|
11
|
-
addDynamicEntity: () => Entity;
|
|
12
|
-
removeEntity: (entity: Entity) => void;
|
|
13
|
-
addSystem: (fn: Update) => void;
|
|
14
|
-
defineComponent: <T extends EcsType<any>>(componentId: number, spec: T) => ComponentDefinition<T>;
|
|
15
|
-
mutableGroupOf: <T_1 extends [ComponentDefinition<EcsType<any>>, ...ComponentDefinition<EcsType<any>>[]]>(...components: T_1) => Iterable<[Entity, ...ComponentEcsType<T_1>]>;
|
|
16
|
-
groupOf: <T_2 extends [ComponentDefinition<EcsType<any>>, ...ComponentDefinition<EcsType<any>>[]]>(...components: T_2) => Iterable<[Entity, ...DeepReadonly<ComponentEcsType<T_2>>]>;
|
|
17
|
-
getComponent: <T_3 extends EcsType<any>>(componentId: number) => ComponentDefinition<T_3>;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* @alpha
|
|
21
|
-
*/
|
|
22
|
-
export declare type PreEngine = ReturnType<typeof preEngine>;
|
|
23
|
-
/**
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export declare function Engine(): IEngine;
|
|
27
|
-
export {};
|
|
28
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAmB,MAAM,UAAU,CAAA;AAClD,OAAO,EACL,mBAAmB,EAEpB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,iBAAS,SAAS;;;;0BAkBY,OAAO;;2BAUL,MAAM;oBAjBb,MAAM;2DA6Bd,MAAM;;;0DAYN,MAAM;EAiEtB;AAED;;GAEG;AACH,oBAAY,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAEpD;;GAEG;AACH,wBAAgB,MAAM,IAAI,OAAO,CA2ChC"}
|