@dcl/ecs 1.0.0-20220601102612.commit-8b31ac4 → 1.0.0-2448628808.commit-1a55b7a
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 +1676 -3
- package/dist/index.js +5815 -3
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/package.json +8 -5
- package/dist/Math.d.ts +0 -2
- package/dist/Math.js +0 -2
- package/dist/built-in-types/ArrayType.d.ts +0 -5
- package/dist/built-in-types/ArrayType.js +0 -21
- package/dist/built-in-types/EcsType.d.ts +0 -8
- package/dist/built-in-types/EcsType.js +0 -1
- package/dist/built-in-types/MapType.d.ts +0 -18
- package/dist/built-in-types/MapType.js +0 -22
- package/dist/built-in-types/Optional.d.ts +0 -5
- package/dist/built-in-types/Optional.js +0 -22
- package/dist/built-in-types/basic/Boolean.d.ts +0 -5
- package/dist/built-in-types/basic/Boolean.js +0 -11
- package/dist/built-in-types/basic/Enum.d.ts +0 -5
- package/dist/built-in-types/basic/Enum.js +0 -13
- package/dist/built-in-types/basic/Float.d.ts +0 -9
- package/dist/built-in-types/basic/Float.js +0 -22
- package/dist/built-in-types/basic/Integer.d.ts +0 -17
- package/dist/built-in-types/basic/Integer.js +0 -44
- package/dist/built-in-types/basic/String.d.ts +0 -9
- package/dist/built-in-types/basic/String.js +0 -15
- package/dist/built-in-types/index.d.ts +0 -9
- package/dist/built-in-types/index.js +0 -9
- package/dist/built-in-types/typing.d.ts +0 -16
- package/dist/built-in-types/typing.js +0 -1
- package/dist/components/generated/AudioSource.d.ts +0 -1
- package/dist/components/generated/AudioSource.js +0 -19
- package/dist/components/generated/AudioStream.d.ts +0 -1
- package/dist/components/generated/AudioStream.js +0 -19
- package/dist/components/generated/BoxShape.d.ts +0 -1
- package/dist/components/generated/BoxShape.js +0 -19
- package/dist/components/generated/CylinderShape.d.ts +0 -1
- package/dist/components/generated/CylinderShape.js +0 -19
- package/dist/components/generated/PlaneShape.d.ts +0 -1
- package/dist/components/generated/PlaneShape.js +0 -19
- package/dist/components/generated/SphereShape.d.ts +0 -1
- package/dist/components/generated/SphereShape.js +0 -19
- package/dist/components/generated/index.d.ts +0 -9
- package/dist/components/generated/index.js +0 -16
- package/dist/components/generated/pb/AudioSource.d.ts +0 -8
- package/dist/components/generated/pb/AudioSource.js +0 -74
- package/dist/components/generated/pb/AudioStream.d.ts +0 -5
- package/dist/components/generated/pb/AudioStream.js +0 -49
- package/dist/components/generated/pb/BoxShape.d.ts +0 -6
- package/dist/components/generated/pb/BoxShape.js +0 -70
- package/dist/components/generated/pb/CylinderShape.d.ts +0 -7
- package/dist/components/generated/pb/CylinderShape.js +0 -67
- package/dist/components/generated/pb/PlaneShape.d.ts +0 -6
- package/dist/components/generated/pb/PlaneShape.js +0 -70
- package/dist/components/generated/pb/SphereShape.d.ts +0 -5
- package/dist/components/generated/pb/SphereShape.js +0 -49
- package/dist/components/index.d.ts +0 -15
- package/dist/components/index.js +0 -7
- package/dist/components/legacy/Transform.d.ts +0 -14
- package/dist/components/legacy/Transform.js +0 -28
- package/dist/components/legacy/index.d.ts +0 -11
- package/dist/components/legacy/index.js +0 -9
- package/dist/components/legacy/types.d.ts +0 -51
- package/dist/components/legacy/types.js +0 -53
- package/dist/components/types.d.ts +0 -3
- package/dist/components/types.js +0 -4
- package/dist/engine/component.d.ts +0 -34
- package/dist/engine/component.js +0 -98
- package/dist/engine/entity-utils.d.ts +0 -7
- package/dist/engine/entity-utils.js +0 -18
- package/dist/engine/entity.d.ts +0 -20
- package/dist/engine/entity.js +0 -75
- package/dist/engine/index.d.ts +0 -11
- package/dist/engine/index.js +0 -132
- package/dist/engine/types.d.ts +0 -34
- package/dist/engine/types.js +0 -1
- package/dist/engine/utils.d.ts +0 -4
- package/dist/engine/utils.js +0 -11
- package/dist/proto-definitions/AudioSource.proto +0 -16
- package/dist/proto-definitions/AudioStream.proto +0 -13
- package/dist/proto-definitions/BoxShape.proto +0 -14
- package/dist/proto-definitions/CylinderShape.proto +0 -15
- package/dist/proto-definitions/PlaneShape.proto +0 -14
- package/dist/proto-definitions/README.md +0 -0
- package/dist/proto-definitions/SphereShape.proto +0 -13
- package/dist/proto-definitions/Transform.md +0 -23
- package/dist/serialization/ByteBuffer/index.d.ts +0 -130
- package/dist/serialization/ByteBuffer/index.js +0 -281
- package/dist/serialization/crdt/componentOperation.d.ts +0 -25
- package/dist/serialization/crdt/componentOperation.js +0 -39
- package/dist/serialization/wireMessage.d.ts +0 -39
- package/dist/serialization/wireMessage.js +0 -53
- package/dist/systems/crdt/index.d.ts +0 -6
- package/dist/systems/crdt/index.js +0 -147
- package/dist/systems/crdt/transport.d.ts +0 -8
- package/dist/systems/crdt/transport.js +0 -21
- package/dist/systems/crdt/types.d.ts +0 -10
- package/dist/systems/crdt/types.js +0 -1
- package/dist/systems/crdt/utils.d.ts +0 -11
- package/dist/systems/crdt/utils.js +0 -51
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/ecs",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-2448628808.commit-1a55b7a",
|
|
4
4
|
"description": "Decentraland ECS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/decentraland/ecs#readme",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@dcl/dcl-rollup": "^6.11.
|
|
25
|
-
"@dcl/eslint-config": "^1.0.3",
|
|
24
|
+
"@dcl/dcl-rollup": "^6.11.1-2420975861.commit-4673308",
|
|
26
25
|
"@microsoft/api-extractor": "^7.23.1",
|
|
27
26
|
"@types/fs-extra": "^9.0.13",
|
|
28
27
|
"@types/jest": "^27.5.0",
|
|
@@ -40,7 +39,11 @@
|
|
|
40
39
|
"@dcl/ecs-math": "^2.0.1-20220526123120.commit-dab2aff"
|
|
41
40
|
},
|
|
42
41
|
"files": [
|
|
43
|
-
"dist/"
|
|
42
|
+
"dist/index.js",
|
|
43
|
+
"dist/index.d.ts",
|
|
44
|
+
"dist/index.min.js",
|
|
45
|
+
"dist/index.min.js.map",
|
|
46
|
+
"proto-definitions"
|
|
44
47
|
],
|
|
45
|
-
"commit": "
|
|
48
|
+
"commit": "1a55b7acbbd52b36ce1e1cff935a38cb353829ef"
|
|
46
49
|
}
|
package/dist/Math.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { DEG2RAD, double, Epsilon, float, FloatArray, ISize, Nullable, Orientation, Quaternion, RAD2DEG, Space, ToGammaSpace, ToLinearSpace, Vector3, DeepReadonly } from '@dcl/ecs-math';
|
|
2
|
-
export { DEG2RAD, double, Epsilon, float, FloatArray, ISize, Nullable, Orientation, Quaternion, RAD2DEG, Space, ToGammaSpace, ToLinearSpace, Vector3, DeepReadonly };
|
package/dist/Math.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export function ArrayType(type) {
|
|
5
|
-
return {
|
|
6
|
-
serialize(value, builder) {
|
|
7
|
-
builder.writeUint32(value.length);
|
|
8
|
-
for (const item of value) {
|
|
9
|
-
type.serialize(item, builder);
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
deserialize(reader) {
|
|
13
|
-
const newArray = [];
|
|
14
|
-
const length = reader.readUint32();
|
|
15
|
-
for (let index = 0; index < length; index++) {
|
|
16
|
-
newArray.push(type.deserialize(reader));
|
|
17
|
-
}
|
|
18
|
-
return newArray;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { EcsType } from './EcsType';
|
|
2
|
-
import { ToOptional } from './typing';
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export interface Spec {
|
|
7
|
-
[key: string]: EcsType;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare type Result<T extends Spec> = ToOptional<{
|
|
13
|
-
[K in keyof T]: T[K] extends EcsType ? ReturnType<T[K]['deserialize']> : T[K] extends Spec ? Result<T[K]> : never;
|
|
14
|
-
}>;
|
|
15
|
-
/**
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
export declare function MapType<T extends Spec>(spec: T): EcsType<Result<T>>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export function MapType(spec) {
|
|
5
|
-
return {
|
|
6
|
-
serialize(value, builder) {
|
|
7
|
-
for (const key in spec) {
|
|
8
|
-
// TODO: as any
|
|
9
|
-
spec[key].serialize(value[key], builder);
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
deserialize(reader) {
|
|
13
|
-
const newValue = {};
|
|
14
|
-
for (const key in spec) {
|
|
15
|
-
// TODO: as any
|
|
16
|
-
;
|
|
17
|
-
newValue[key] = spec[key].deserialize(reader);
|
|
18
|
-
}
|
|
19
|
-
return newValue;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export function Optional(spec) {
|
|
5
|
-
return {
|
|
6
|
-
serialize(value, builder) {
|
|
7
|
-
if (value) {
|
|
8
|
-
builder.writeInt8(1);
|
|
9
|
-
spec.serialize(value, builder);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
builder.writeInt8(0);
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
deserialize(reader) {
|
|
16
|
-
const exists = reader.readInt8();
|
|
17
|
-
if (exists) {
|
|
18
|
-
return spec.deserialize(reader);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export const Float32 = {
|
|
5
|
-
serialize(value, builder) {
|
|
6
|
-
builder.writeFloat32(value);
|
|
7
|
-
},
|
|
8
|
-
deserialize(reader) {
|
|
9
|
-
return reader.readFloat32();
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export const Float64 = {
|
|
16
|
-
serialize(value, builder) {
|
|
17
|
-
builder.writeFloat64(value);
|
|
18
|
-
},
|
|
19
|
-
deserialize(reader) {
|
|
20
|
-
return reader.readFloat64();
|
|
21
|
-
}
|
|
22
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { EcsType } from '../EcsType';
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
*/
|
|
5
|
-
export declare const Int64: EcsType<number>;
|
|
6
|
-
/**
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export declare const Int32: EcsType<number>;
|
|
10
|
-
/**
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare const Int16: EcsType<number>;
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
export declare const Int8: EcsType<number>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export const Int64 = {
|
|
5
|
-
serialize(value, builder) {
|
|
6
|
-
builder.writeInt64(BigInt(value));
|
|
7
|
-
},
|
|
8
|
-
deserialize(reader) {
|
|
9
|
-
return Number(reader.readInt64());
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export const Int32 = {
|
|
16
|
-
serialize(value, builder) {
|
|
17
|
-
builder.writeInt32(value);
|
|
18
|
-
},
|
|
19
|
-
deserialize(reader) {
|
|
20
|
-
return reader.readInt32();
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export const Int16 = {
|
|
27
|
-
serialize(value, builder) {
|
|
28
|
-
builder.writeInt16(value);
|
|
29
|
-
},
|
|
30
|
-
deserialize(reader) {
|
|
31
|
-
return reader.readInt16();
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export const Int8 = {
|
|
38
|
-
serialize(value, builder) {
|
|
39
|
-
builder.writeInt8(value);
|
|
40
|
-
},
|
|
41
|
-
deserialize(reader) {
|
|
42
|
-
return reader.readInt8();
|
|
43
|
-
}
|
|
44
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export const FlatString = {
|
|
5
|
-
serialize(value, builder) {
|
|
6
|
-
builder.writeBuffer(new TextEncoder().encode(value));
|
|
7
|
-
},
|
|
8
|
-
deserialize(reader) {
|
|
9
|
-
return new TextDecoder().decode(reader.readBuffer());
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export const String = FlatString;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './EcsType';
|
|
2
|
-
export * from './MapType';
|
|
3
|
-
export * from './ArrayType';
|
|
4
|
-
export * from './Optional';
|
|
5
|
-
export * from './basic/Integer';
|
|
6
|
-
export * from './basic/Float';
|
|
7
|
-
export * from './basic/String';
|
|
8
|
-
export * from './basic/Enum';
|
|
9
|
-
export * from './basic/Boolean';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './EcsType';
|
|
2
|
-
export * from './MapType';
|
|
3
|
-
export * from './ArrayType';
|
|
4
|
-
export * from './Optional';
|
|
5
|
-
export * from './basic/Integer';
|
|
6
|
-
export * from './basic/Float';
|
|
7
|
-
export * from './basic/String';
|
|
8
|
-
export * from './basic/Enum';
|
|
9
|
-
export * from './basic/Boolean';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** Include property keys from T where the property is assignable to U */
|
|
2
|
-
declare type IncludeUndefined<T> = {
|
|
3
|
-
[P in keyof T]: undefined extends T[P] ? P : never;
|
|
4
|
-
}[keyof T];
|
|
5
|
-
/** Excludes property keys from T where the property is assignable to U */
|
|
6
|
-
declare type ExcludeUndefined<T> = {
|
|
7
|
-
[P in keyof T]: undefined extends T[P] ? never : P;
|
|
8
|
-
}[keyof T];
|
|
9
|
-
declare type OnlyOptionalUndefinedTypes<T> = {
|
|
10
|
-
[K in IncludeUndefined<T>]?: T[K];
|
|
11
|
-
};
|
|
12
|
-
declare type OnlyNonUndefinedTypes<T> = {
|
|
13
|
-
[K in ExcludeUndefined<T>]: T[K];
|
|
14
|
-
};
|
|
15
|
-
export declare type ToOptional<T> = OnlyOptionalUndefinedTypes<T> & OnlyNonUndefinedTypes<T>;
|
|
16
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PBAudioSource } from './pb/AudioSource';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export const COMPONENT_ID = 20;
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const AudioSource = {
|
|
10
|
-
serialize(value, builder) {
|
|
11
|
-
const writer = PBAudioSource.encode(value);
|
|
12
|
-
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
13
|
-
builder.writeBuffer(buffer);
|
|
14
|
-
},
|
|
15
|
-
deserialize(reader) {
|
|
16
|
-
const buf = reader.readBuffer();
|
|
17
|
-
return PBAudioSource.decode(buf, buf.length);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PBAudioStream } from './pb/AudioStream';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export const COMPONENT_ID = 21;
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const AudioStream = {
|
|
10
|
-
serialize(value, builder) {
|
|
11
|
-
const writer = PBAudioStream.encode(value);
|
|
12
|
-
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
13
|
-
builder.writeBuffer(buffer);
|
|
14
|
-
},
|
|
15
|
-
deserialize(reader) {
|
|
16
|
-
const buf = reader.readBuffer();
|
|
17
|
-
return PBAudioStream.decode(buf, buf.length);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PBBoxShape } from './pb/BoxShape';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export const COMPONENT_ID = 13;
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const BoxShape = {
|
|
10
|
-
serialize(value, builder) {
|
|
11
|
-
const writer = PBBoxShape.encode(value);
|
|
12
|
-
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
13
|
-
builder.writeBuffer(buffer);
|
|
14
|
-
},
|
|
15
|
-
deserialize(reader) {
|
|
16
|
-
const buf = reader.readBuffer();
|
|
17
|
-
return PBBoxShape.decode(buf, buf.length);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PBCylinderShape } from './pb/CylinderShape';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export const COMPONENT_ID = 17;
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const CylinderShape = {
|
|
10
|
-
serialize(value, builder) {
|
|
11
|
-
const writer = PBCylinderShape.encode(value);
|
|
12
|
-
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
13
|
-
builder.writeBuffer(buffer);
|
|
14
|
-
},
|
|
15
|
-
deserialize(reader) {
|
|
16
|
-
const buf = reader.readBuffer();
|
|
17
|
-
return PBCylinderShape.decode(buf, buf.length);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PBPlaneShape } from './pb/PlaneShape';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export const COMPONENT_ID = 14;
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const PlaneShape = {
|
|
10
|
-
serialize(value, builder) {
|
|
11
|
-
const writer = PBPlaneShape.encode(value);
|
|
12
|
-
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
13
|
-
builder.writeBuffer(buffer);
|
|
14
|
-
},
|
|
15
|
-
deserialize(reader) {
|
|
16
|
-
const buf = reader.readBuffer();
|
|
17
|
-
return PBPlaneShape.decode(buf, buf.length);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PBSphereShape } from './pb/SphereShape';
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export const COMPONENT_ID = 15;
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const SphereShape = {
|
|
10
|
-
serialize(value, builder) {
|
|
11
|
-
const writer = PBSphereShape.encode(value);
|
|
12
|
-
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
13
|
-
builder.writeBuffer(buffer);
|
|
14
|
-
},
|
|
15
|
-
deserialize(reader) {
|
|
16
|
-
const buf = reader.readBuffer();
|
|
17
|
-
return PBSphereShape.decode(buf, buf.length);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IEngine } from '../../engine/types';
|
|
2
|
-
export declare function defineProtocolBufferComponents({ defineComponent }: Pick<IEngine, 'defineComponent'>): {
|
|
3
|
-
AudioSource: import("../..").ComponentDefinition<import("../..").EcsType<import("./pb/AudioSource").PBAudioSource>>;
|
|
4
|
-
AudioStream: import("../..").ComponentDefinition<import("../..").EcsType<import("./pb/AudioStream").PBAudioStream>>;
|
|
5
|
-
BoxShape: import("../..").ComponentDefinition<import("../..").EcsType<import("./pb/BoxShape").PBBoxShape>>;
|
|
6
|
-
CylinderShape: import("../..").ComponentDefinition<import("../..").EcsType<import("./pb/CylinderShape").PBCylinderShape>>;
|
|
7
|
-
PlaneShape: import("../..").ComponentDefinition<import("../..").EcsType<import("./pb/PlaneShape").PBPlaneShape>>;
|
|
8
|
-
SphereShape: import("../..").ComponentDefinition<import("../..").EcsType<import("./pb/SphereShape").PBSphereShape>>;
|
|
9
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as AudioSource from './AudioSource';
|
|
2
|
-
import * as AudioStream from './AudioStream';
|
|
3
|
-
import * as BoxShape from './BoxShape';
|
|
4
|
-
import * as CylinderShape from './CylinderShape';
|
|
5
|
-
import * as PlaneShape from './PlaneShape';
|
|
6
|
-
import * as SphereShape from './SphereShape';
|
|
7
|
-
export function defineProtocolBufferComponents({ defineComponent }) {
|
|
8
|
-
return {
|
|
9
|
-
AudioSource: defineComponent(AudioSource.COMPONENT_ID, AudioSource.AudioSource),
|
|
10
|
-
AudioStream: defineComponent(AudioStream.COMPONENT_ID, AudioStream.AudioStream),
|
|
11
|
-
BoxShape: defineComponent(BoxShape.COMPONENT_ID, BoxShape.BoxShape),
|
|
12
|
-
CylinderShape: defineComponent(CylinderShape.COMPONENT_ID, CylinderShape.CylinderShape),
|
|
13
|
-
PlaneShape: defineComponent(PlaneShape.COMPONENT_ID, PlaneShape.PlaneShape),
|
|
14
|
-
SphereShape: defineComponent(SphereShape.COMPONENT_ID, SphereShape.SphereShape)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import * as _m0 from "protobufjs/minimal";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export const protobufPackage = "decentraland.ecs";
|
|
7
|
-
function createBasePBAudioSource() {
|
|
8
|
-
return {
|
|
9
|
-
playing: false,
|
|
10
|
-
volume: 0,
|
|
11
|
-
loop: false,
|
|
12
|
-
pitch: 0,
|
|
13
|
-
playedAtTimestamp: 0,
|
|
14
|
-
audioClipUrl: "",
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export const PBAudioSource = {
|
|
21
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
22
|
-
if (message.playing === true) {
|
|
23
|
-
writer.uint32(8).bool(message.playing);
|
|
24
|
-
}
|
|
25
|
-
if (message.volume !== 0) {
|
|
26
|
-
writer.uint32(21).float(message.volume);
|
|
27
|
-
}
|
|
28
|
-
if (message.loop === true) {
|
|
29
|
-
writer.uint32(24).bool(message.loop);
|
|
30
|
-
}
|
|
31
|
-
if (message.pitch !== 0) {
|
|
32
|
-
writer.uint32(37).float(message.pitch);
|
|
33
|
-
}
|
|
34
|
-
if (message.playedAtTimestamp !== 0) {
|
|
35
|
-
writer.uint32(40).int32(message.playedAtTimestamp);
|
|
36
|
-
}
|
|
37
|
-
if (message.audioClipUrl !== "") {
|
|
38
|
-
writer.uint32(50).string(message.audioClipUrl);
|
|
39
|
-
}
|
|
40
|
-
return writer;
|
|
41
|
-
},
|
|
42
|
-
decode(input, length) {
|
|
43
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
44
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
45
|
-
const message = createBasePBAudioSource();
|
|
46
|
-
while (reader.pos < end) {
|
|
47
|
-
const tag = reader.uint32();
|
|
48
|
-
switch (tag >>> 3) {
|
|
49
|
-
case 1:
|
|
50
|
-
message.playing = reader.bool();
|
|
51
|
-
break;
|
|
52
|
-
case 2:
|
|
53
|
-
message.volume = reader.float();
|
|
54
|
-
break;
|
|
55
|
-
case 3:
|
|
56
|
-
message.loop = reader.bool();
|
|
57
|
-
break;
|
|
58
|
-
case 4:
|
|
59
|
-
message.pitch = reader.float();
|
|
60
|
-
break;
|
|
61
|
-
case 5:
|
|
62
|
-
message.playedAtTimestamp = reader.int32();
|
|
63
|
-
break;
|
|
64
|
-
case 6:
|
|
65
|
-
message.audioClipUrl = reader.string();
|
|
66
|
-
break;
|
|
67
|
-
default:
|
|
68
|
-
reader.skipType(tag & 7);
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return message;
|
|
73
|
-
},
|
|
74
|
-
};
|