@dcl/ecs 7.1.4-4502579506.commit-4147243 → 7.1.4-4512634654.commit-0e8d9c4
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/composite/index.d.ts +40 -3
- package/dist/composite/index.js +44 -3
- package/dist/composite/instance.d.ts +9 -13
- package/dist/composite/instance.js +3 -11
- package/dist/composite/proto/gen/composite.gen.d.ts +1 -1
- package/dist/composite/proto/gen/composite.gen.js +3 -3
- package/package.json +3 -3
- package/dist/composite/serialization.d.ts +0 -5
- package/dist/composite/serialization.js +0 -17
- package/dist/composite/types.d.ts +0 -11
- package/dist/composite/types.js +0 -2
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { IEngine } from '../engine';
|
|
2
|
+
import { CompositeRootType, getCompositeRootComponent } from './components';
|
|
3
|
+
import { CompositeProvider, EntityMappingMode, InstanceCompositeOptions } from './instance';
|
|
4
|
+
import type { ComponentData, CompositeComponent, CompositeComponent_DataEntry } from './proto/gen/composite.gen';
|
|
5
|
+
import { CompositeDefinition } from './proto/gen/composite.gen';
|
|
6
|
+
export type { CompositeDefinition, ComponentData, CompositeComponent, CompositeComponent_DataEntry, InstanceCompositeOptions, CompositeProvider, CompositeRootType };
|
|
7
|
+
export { EntityMappingMode };
|
|
8
|
+
export { getCompositeRootComponent };
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
* @deprecated composite is not being supported so far, please do not use this feature
|
|
12
|
+
*/
|
|
13
|
+
export type Composite = CompositeDefinition;
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
* @deprecated composite is not being supported so far, please do not use this feature
|
|
17
|
+
*/
|
|
18
|
+
export declare namespace Composite {
|
|
19
|
+
/** @public */
|
|
20
|
+
type Type = CompositeDefinition;
|
|
21
|
+
/** @public */
|
|
22
|
+
type Provider = CompositeProvider;
|
|
23
|
+
/** @public */
|
|
24
|
+
function fromJson(object: any): Composite.Type;
|
|
25
|
+
/** @public */
|
|
26
|
+
function fromBinary(buffer: Uint8Array): Composite.Type;
|
|
27
|
+
/** @public */
|
|
28
|
+
function toJson(composite: Composite.Type): any;
|
|
29
|
+
/** @public */
|
|
30
|
+
function toBinary(composite: Composite.Type): Uint8Array;
|
|
31
|
+
/**
|
|
32
|
+
* Instance a composite and returns its root entity
|
|
33
|
+
* @param compositeData - state serialized by the CRDT protocol
|
|
34
|
+
* @param getNextAvailableEntity - function that gives unused entities
|
|
35
|
+
* @param rootEntity - (optional) suggested mapped rootEntity for the composite
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
function instance(engine: IEngine, compositeData: Composite.Type, compositeProvider: CompositeProvider, options?: InstanceCompositeOptions): void;
|
|
40
|
+
}
|
package/dist/composite/index.js
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { getCompositeRootComponent } from './components';
|
|
2
|
+
import { EntityMappingMode, instanceComposite } from './instance';
|
|
3
|
+
import { CompositeDefinition } from './proto/gen/composite.gen';
|
|
4
|
+
export { EntityMappingMode };
|
|
5
|
+
export { getCompositeRootComponent };
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
* @deprecated composite is not being supported so far, please do not use this feature
|
|
9
|
+
*/
|
|
10
|
+
export var Composite;
|
|
11
|
+
(function (Composite) {
|
|
12
|
+
/** @public */
|
|
13
|
+
function fromJson(object) {
|
|
14
|
+
return CompositeDefinition.fromJSON(object);
|
|
15
|
+
}
|
|
16
|
+
Composite.fromJson = fromJson;
|
|
17
|
+
/** @public */
|
|
18
|
+
function fromBinary(buffer) {
|
|
19
|
+
return CompositeDefinition.decode(buffer);
|
|
20
|
+
}
|
|
21
|
+
Composite.fromBinary = fromBinary;
|
|
22
|
+
/** @public */
|
|
23
|
+
function toJson(composite) {
|
|
24
|
+
return CompositeDefinition.toJSON(composite);
|
|
25
|
+
}
|
|
26
|
+
Composite.toJson = toJson;
|
|
27
|
+
/** @public */
|
|
28
|
+
function toBinary(composite) {
|
|
29
|
+
return CompositeDefinition.encode(composite).finish();
|
|
30
|
+
}
|
|
31
|
+
Composite.toBinary = toBinary;
|
|
32
|
+
/**
|
|
33
|
+
* Instance a composite and returns its root entity
|
|
34
|
+
* @param compositeData - state serialized by the CRDT protocol
|
|
35
|
+
* @param getNextAvailableEntity - function that gives unused entities
|
|
36
|
+
* @param rootEntity - (optional) suggested mapped rootEntity for the composite
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
/*#__PURE__*/ function instance(engine, compositeData, compositeProvider, options = {}) {
|
|
41
|
+
instanceComposite(engine, compositeData, compositeProvider, options);
|
|
42
|
+
}
|
|
43
|
+
Composite.instance = instance;
|
|
44
|
+
})(Composite || (Composite = {}));
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { Entity } from '../engine/entity';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { CompositeDefinition } from './proto/gen/composite.gen';
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type CompositeProvider = {
|
|
7
|
+
getCompositeOrNull(id: string): CompositeDefinition | null;
|
|
8
|
+
};
|
|
9
|
+
/** @public */
|
|
4
10
|
export declare enum EntityMappingMode {
|
|
5
11
|
EMM_NONE = 0,
|
|
6
12
|
EMM_NEXT_AVAILABLE = 1,
|
|
7
13
|
EMM_DIRECT_MAPPING = 2
|
|
8
14
|
}
|
|
15
|
+
/** @public */
|
|
9
16
|
export type InstanceCompositeOptions = {
|
|
10
17
|
entityMapping?: {
|
|
11
18
|
type: EntityMappingMode.EMM_NEXT_AVAILABLE;
|
|
@@ -17,14 +24,3 @@ export type InstanceCompositeOptions = {
|
|
|
17
24
|
rootEntity?: Entity;
|
|
18
25
|
alreadyRequestedId?: Set<string>;
|
|
19
26
|
};
|
|
20
|
-
/**
|
|
21
|
-
* Instance a composite and returns its root entity
|
|
22
|
-
* @param compositeData state serialized by the CRDT protocol
|
|
23
|
-
* @param getNextAvailableEntity function that gives unused entities
|
|
24
|
-
* @param rootEntity (optional) suggested mapped rootEntity for the composite
|
|
25
|
-
*
|
|
26
|
-
* @public
|
|
27
|
-
* @deprecated composite is not being supported so far, please do not use this feature
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
export declare function instanceComposite(engine: IEngine, compositeData: Composite, compositeProvider: CompositeProvider, options?: InstanceCompositeOptions): Entity;
|
|
@@ -3,7 +3,7 @@ import { componentNumberFromName } from '../components/component-number';
|
|
|
3
3
|
import { Schemas } from '../schemas';
|
|
4
4
|
import { ReadWriteByteBuffer } from '../serialization/ByteBuffer';
|
|
5
5
|
import { getCompositeRootComponent } from './components';
|
|
6
|
-
|
|
6
|
+
/** @public */
|
|
7
7
|
export var EntityMappingMode;
|
|
8
8
|
(function (EntityMappingMode) {
|
|
9
9
|
EntityMappingMode[EntityMappingMode["EMM_NONE"] = 0] = "EMM_NONE";
|
|
@@ -73,17 +73,9 @@ export function getEntityMapping(engine, compositeEntity, mappedEntities, { enti
|
|
|
73
73
|
return newEntity;
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
77
|
-
* @param compositeData state serialized by the CRDT protocol
|
|
78
|
-
* @param getNextAvailableEntity function that gives unused entities
|
|
79
|
-
* @param rootEntity (optional) suggested mapped rootEntity for the composite
|
|
80
|
-
*
|
|
81
|
-
* @public
|
|
82
|
-
* @deprecated composite is not being supported so far, please do not use this feature
|
|
83
|
-
*
|
|
76
|
+
* @internal
|
|
84
77
|
*/
|
|
85
|
-
|
|
86
|
-
export function instanceComposite(engine, compositeData, compositeProvider, options = {}) {
|
|
78
|
+
export function instanceComposite(engine, compositeData, compositeProvider, options) {
|
|
87
79
|
const { rootEntity, alreadyRequestedId: optionalAlreadyRequestedId, entityMapping } = options;
|
|
88
80
|
const alreadyRequestedId = optionalAlreadyRequestedId || new Set();
|
|
89
81
|
const TransformComponentNumber = componentNumberFromName('core::Transform');
|
|
@@ -183,7 +183,7 @@ export const CompositeComponent_DataEntry = {
|
|
|
183
183
|
return obj;
|
|
184
184
|
},
|
|
185
185
|
};
|
|
186
|
-
function
|
|
186
|
+
function createBaseCompositeDefinition() {
|
|
187
187
|
return { id: "", components: [] };
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
@@ -192,7 +192,7 @@ function createBaseComposite() {
|
|
|
192
192
|
/**
|
|
193
193
|
* @internal
|
|
194
194
|
*/
|
|
195
|
-
export const
|
|
195
|
+
export const CompositeDefinition = {
|
|
196
196
|
encode(message, writer = _m0.Writer.create()) {
|
|
197
197
|
if (message.id !== "") {
|
|
198
198
|
writer.uint32(10).string(message.id);
|
|
@@ -205,7 +205,7 @@ export const Composite = {
|
|
|
205
205
|
decode(input, length) {
|
|
206
206
|
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
207
207
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
208
|
-
const message =
|
|
208
|
+
const message = createBaseCompositeDefinition();
|
|
209
209
|
while (reader.pos < end) {
|
|
210
210
|
const tag = reader.uint32();
|
|
211
211
|
switch (tag >>> 3) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/ecs",
|
|
3
3
|
"description": "Decentraland ECS",
|
|
4
|
-
"version": "7.1.4-
|
|
4
|
+
"version": "7.1.4-4512634654.commit-0e8d9c4",
|
|
5
5
|
"author": "DCL",
|
|
6
6
|
"bugs": "https://github.com/decentraland/ecs/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@dcl/js-runtime": "7.1.4-
|
|
8
|
+
"@dcl/js-runtime": "7.1.4-4512634654.commit-0e8d9c4"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"ts-proto": "^1.122.0"
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
},
|
|
35
35
|
"types": "./dist/index.d.ts",
|
|
36
36
|
"typings": "./dist/index.d.ts",
|
|
37
|
-
"commit": "
|
|
37
|
+
"commit": "0e8d9c481e3aa08d0f725b39013572c7446b8e30"
|
|
38
38
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Composite } from './proto/gen/composite.gen';
|
|
2
|
-
export declare function compositeFromJson(object: any): Composite;
|
|
3
|
-
export declare function compositeFromBinary(buffer: Uint8Array): Composite;
|
|
4
|
-
export declare function compositeToJson(composite: Composite): any;
|
|
5
|
-
export declare function compositeToBinary(composite: Composite): Uint8Array;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Composite } from './proto/gen/composite.gen';
|
|
2
|
-
/* @public @deprecated */
|
|
3
|
-
export function compositeFromJson(object) {
|
|
4
|
-
return Composite.fromJSON(object);
|
|
5
|
-
}
|
|
6
|
-
/* @public @deprecated */
|
|
7
|
-
export function compositeFromBinary(buffer) {
|
|
8
|
-
return Composite.decode(buffer);
|
|
9
|
-
}
|
|
10
|
-
/* @public @deprecated */
|
|
11
|
-
export function compositeToJson(composite) {
|
|
12
|
-
return Composite.toJSON(composite);
|
|
13
|
-
}
|
|
14
|
-
/* @public @deprecated */
|
|
15
|
-
export function compositeToBinary(composite) {
|
|
16
|
-
return Composite.encode(composite).finish();
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ComponentData, CompositeComponent, CompositeComponent_DataEntry } from './proto/gen/composite.gen';
|
|
2
|
-
import { Composite } from './proto/gen/composite.gen';
|
|
3
|
-
export type { ComponentData, CompositeComponent, CompositeComponent_DataEntry };
|
|
4
|
-
export { Composite };
|
|
5
|
-
/**
|
|
6
|
-
* @public
|
|
7
|
-
* @deprecated composite is not being supported so far, please do not use this feature
|
|
8
|
-
*/
|
|
9
|
-
export type CompositeProvider = {
|
|
10
|
-
getCompositeOrNull: (id: string) => Composite | null;
|
|
11
|
-
};
|
package/dist/composite/types.js
DELETED