@woosh/meep-engine 2.54.0 → 2.55.0
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/__module.js +1 -1
- package/src/core/cache/Cache.js +1 -1
- package/src/core/collection/Stack.js +11 -14
- package/src/core/collection/array/array_contains_duplicates.js +5 -2
- package/src/core/collection/array/array_contains_duplicates.spec.js +14 -0
- package/src/core/collection/array/array_copy_entire.js +6 -11
- package/src/core/collection/array/array_get_index_in_range.js +5 -0
- package/src/core/collection/array/array_get_index_in_range.spec.js +16 -0
- package/src/core/collection/array/groupArrayBy.js +1 -1
- package/src/core/collection/array/isArrayEqual.js +4 -1
- package/src/core/collection/array/randomizeArrayElementOrder.js +1 -0
- package/src/core/collection/array/randomizeArrayElementOrder.spec.js +27 -0
- package/src/core/collection/heap/Uin32Heap.spec.js +64 -0
- package/src/core/collection/heap/Uint32Heap.js +6 -2
- package/src/core/collection/list/List.js +1 -0
- package/src/core/collection/{HashMap.js → map/HashMap.js} +10 -10
- package/src/core/collection/{HashMap.spec.js → map/HashMap.spec.js} +1 -1
- package/src/core/collection/{ObservedMap.js → map/ObservedMap.js} +1 -1
- package/src/core/collection/{HashSet.js → set/HashSet.js} +4 -3
- package/src/core/collection/{Set.d.ts → set/Set.d.ts} +1 -1
- package/src/core/collection/{Set.js → set/Set.js} +17 -14
- package/src/core/geom/2d/aabb/AABB2.js +1 -1
- package/src/core/geom/3d/aabb/AABB3.js +3 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_calc_edges.js +1 -1
- package/src/core/model/ObservedInteger.js +12 -7
- package/src/core/model/ObservedString.js +10 -8
- package/src/core/model/node-graph/visual/NodeGraphVisualData.js +1 -1
- package/src/core/model/object/ImmutableObjectPool.js +1 -1
- package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.js +1 -1
- package/src/engine/asset/AssetManager.js +3 -3
- package/src/engine/asset/loaders/GLTFAssetLoader.js +1 -1
- package/src/engine/ecs/EntityBlueprint.js +8 -10
- package/src/engine/ecs/animation/AnimationSerializationAdapter.js +2 -5
- package/src/engine/ecs/components/Motion.js +0 -27
- package/src/engine/ecs/components/MotionSerializationAdapter.js +26 -0
- package/src/engine/ecs/components/PropertySet.js +0 -29
- package/src/engine/ecs/components/PropertySetSerializationAdapter.js +29 -0
- package/src/engine/ecs/components/SerializationMetadata.js +0 -28
- package/src/engine/ecs/components/SerializationMetadataSerializationAdapter.js +26 -0
- package/src/engine/ecs/components/Steering.js +0 -35
- package/src/engine/ecs/components/SteeringSerializationAdapter.js +34 -0
- package/src/engine/ecs/components/Tag.js +6 -102
- package/src/engine/ecs/components/TagSerializationAdapter.js +44 -0
- package/src/engine/ecs/components/TagSerializationUpgrader_0_1.js +18 -0
- package/src/engine/ecs/components/Timer.js +1 -1
- package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleCooldownDescription.js +10 -14
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +31 -39
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.js +1 -1
- package/src/engine/ecs/dynamic_actions/{DynamicRuleDescriptionTable.spec.js → rules/DynamicRuleDescriptionTable.spec.js} +12 -12
- package/src/engine/ecs/foliage/ecs/InstancedMeshSerializationAdapter.js +2 -5
- package/src/engine/ecs/fow/serialization/FogOfWarRevealerSerializationAdapter.js +2 -5
- package/src/engine/ecs/fow/serialization/FogOfWarSerializationAdapter.js +5 -8
- package/src/engine/ecs/gui/GUIElementSerializationAdapter.js +2 -5
- package/src/engine/ecs/gui/hud/HeadsUpDisplaySerializationAdapter.js +3 -6
- package/src/engine/ecs/gui/position/ViewportPosition.js +2 -5
- package/src/engine/ecs/ik/IKConstraint.js +95 -0
- package/src/engine/ecs/ik/InverseKinematics.js +10 -169
- package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.js +72 -0
- package/src/engine/ecs/speaker/Voice.js +5 -8
- package/src/engine/ecs/speaker/VoiceSystem.js +15 -19
- package/src/engine/ecs/speaker/lines/LineDescription.js +20 -25
- package/src/engine/ecs/speaker/lines/sets/LineSetDescription.js +15 -19
- package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +7 -0
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.js +1 -1
- package/src/engine/ecs/storage/binary/object/ObjectBasedClassSerializationAdapter.js +6 -9
- package/src/engine/ecs/team/TeamSerializationAdapter.js +2 -5
- package/src/engine/ecs/terrain/ecs/Terrain.spec.js +5 -0
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.js +23 -21
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationAdapter.js +2 -5
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.js +2 -40
- package/src/engine/ecs/terrain/serialization/TerrainSerializationAdapter.js +7 -10
- package/src/engine/ecs/tooltip/TooltipComponent.spec.js +47 -0
- package/src/engine/ecs/tooltip/TooltipComponentSerializationAdapter.js +2 -5
- package/src/engine/ecs/transform/Transform.spec.js +52 -0
- package/src/engine/ecs/transform/TransformSerializationAdapter.js +2 -5
- package/src/engine/ecs/transform-attachment/TransformAttachment.js +18 -19
- package/src/engine/graphics/ecs/animation/AnimationController.js +20 -129
- package/src/engine/graphics/ecs/animation/AnimationControllerSerializationAdapter.js +27 -0
- package/src/engine/graphics/ecs/animation/AnimationRule.js +79 -0
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraphSerializationAdapter.js +9 -11
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionSerializationAdapter.js +3 -5
- package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.js +2 -5
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSerializationAdapter.js +2 -6
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLander.js +3 -15
- package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.js +2 -4
- package/src/engine/graphics/ecs/highlight/HighlightSerializationAdapter.js +2 -5
- package/src/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +1 -1
- package/src/engine/graphics/ecs/light/LightSerializationAdapter.js +2 -5
- package/src/engine/graphics/ecs/mesh/serialization/MeshSerializationAdapter.js +2 -5
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +3 -0
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/InstancedRendererAdapter.js +1 -1
- package/src/engine/graphics/ecs/water/WaterSerializationAdapter.js +2 -5
- package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js +1 -1
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +1 -1
- package/src/engine/graphics/material/manager/MaterialManager.js +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +1 -1
- package/src/engine/graphics/particles/node-based/codegen/CodeContext.js +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.js +2 -5
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationAdapter.js +2 -5
- package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.js +1 -1
- package/src/engine/graphics/texture/atlas/ManagedTextureAtlas.js +1 -1
- package/src/engine/graphics/texture/sampler/serialization/Sampler2DSerializationAdapter.js +2 -5
- package/src/engine/grid/grid2transform/GridPosition2Transform.js +11 -13
- package/src/engine/grid/grid2transform/GridPosition2TransformSerializationAdapter.js +3 -5
- package/src/engine/grid/obstacle/GridObstacleSerializationAdapter.js +2 -5
- package/src/engine/grid/position/GridPositionSerializationAdapter.js +2 -5
- package/src/engine/grid/transform2grid/Transform2GridPosition.js +10 -13
- package/src/engine/input/devices/KeyboardDevice.js +5 -2
- package/src/engine/input/devices/KeyboardDevice.spec.js +12 -0
- package/src/engine/input/devices/PointerDevice.js +5 -1
- package/src/engine/input/ecs/components/Input.js +37 -11
- package/src/engine/input/ecs/ism/InputBinding.js +30 -12
- package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.js +7 -10
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehaviorSerializationAdapter.js +2 -5
- package/src/engine/intelligence/behavior/primitive/FailingBehaviorSerializationAdapter.js +2 -6
- package/src/engine/intelligence/behavior/primitive/SucceedingBehaviorSerializationAdapter.js +2 -5
- package/src/engine/intelligence/blackboard/BlackboardSerializationAdapter.js +2 -5
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.js +12 -13
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.spec.js +23 -0
- package/src/engine/navigation/ecs/components/PathSerializationAdapter.js +2 -5
- package/src/engine/navigation/ecs/path_following/PathFollowerSerializationAdapter.js +2 -5
- package/src/engine/navigation/grid/find_path_on_grid_astar.spec.js +25 -0
- package/src/engine/options/OptionAbstract.js +6 -5
- package/src/engine/options/OptionGroup.js +13 -25
- package/src/engine/options/OptionGroup.spec.js +61 -0
- package/src/engine/save/storage/InMemoryStorage.js +3 -2
- package/src/engine/sound/ecs/SoundController.js +2 -6
- package/src/engine/sound/ecs/SoundListener.js +3 -21
- package/src/engine/sound/ecs/emitter/SoundEmitterSerializationAdapter.js +2 -6
- package/src/generation/theme/ThemeEngine.js +1 -1
- package/src/core/collection/LazyStream.js +0 -23
- package/src/core/collection/LazyStream.spec.js +0 -13
- package/src/core/collection/heap/BinaryHeap.js +0 -153
- package/src/engine/ecs/components/GeometryBVH.js +0 -44
- package/src/engine/ecs/systems/GeometryBVHSystem.js +0 -36
- /package/src/core/collection/{HashMap.d.ts → map/HashMap.d.ts} +0 -0
- /package/src/core/collection/{HashSet.d.ts → set/HashSet.d.ts} +0 -0
|
@@ -3,12 +3,9 @@ import { AnimationClip } from "./AnimationClip.js";
|
|
|
3
3
|
import { Animation } from "./Animation.js";
|
|
4
4
|
|
|
5
5
|
export class AnimationSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
7
|
+
klass = Animation;
|
|
8
|
+
version = 0;
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
*
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Time: 20:41
|
|
5
5
|
*/
|
|
6
6
|
import Vector3 from '../../../core/geom/Vector3.js';
|
|
7
|
-
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class Motion {
|
|
@@ -33,29 +32,3 @@ Motion.typeName = "Motion";
|
|
|
33
32
|
export default Motion;
|
|
34
33
|
|
|
35
34
|
|
|
36
|
-
export class MotionSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
37
|
-
constructor() {
|
|
38
|
-
super();
|
|
39
|
-
|
|
40
|
-
this.klass = Motion;
|
|
41
|
-
this.version = 0;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
* @param {BinaryBuffer} buffer
|
|
47
|
-
* @param {Motion} value
|
|
48
|
-
*/
|
|
49
|
-
serialize(buffer, value) {
|
|
50
|
-
value.velocity.toBinaryBufferFloat32(buffer);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
55
|
-
* @param {BinaryBuffer} buffer
|
|
56
|
-
* @param {Motion} value
|
|
57
|
-
*/
|
|
58
|
-
deserialize(buffer, value) {
|
|
59
|
-
value.velocity.fromBinaryBufferFloat32(buffer);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
2
|
+
import Motion from "./Motion.js";
|
|
3
|
+
|
|
4
|
+
export class MotionSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
5
|
+
|
|
6
|
+
klass = Motion;
|
|
7
|
+
version = 0;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {BinaryBuffer} buffer
|
|
12
|
+
* @param {Motion} value
|
|
13
|
+
*/
|
|
14
|
+
serialize(buffer, value) {
|
|
15
|
+
value.velocity.toBinaryBufferFloat32(buffer);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param {BinaryBuffer} buffer
|
|
21
|
+
* @param {Motion} value
|
|
22
|
+
*/
|
|
23
|
+
deserialize(buffer, value) {
|
|
24
|
+
value.velocity.fromBinaryBufferFloat32(buffer);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
import { resolvePath } from "../../../core/json/resolvePath.js";
|
|
7
|
-
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
8
7
|
|
|
9
8
|
function PropertySet(options) {
|
|
10
9
|
this.data = {};
|
|
@@ -110,31 +109,3 @@ PropertySet.prototype.fromBinaryBuffer = function (buffer) {
|
|
|
110
109
|
|
|
111
110
|
export default PropertySet;
|
|
112
111
|
|
|
113
|
-
export class PropertySetSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
114
|
-
constructor() {
|
|
115
|
-
super();
|
|
116
|
-
|
|
117
|
-
this.klass = PropertySet;
|
|
118
|
-
this.version = 0;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
*
|
|
123
|
-
* @param {BinaryBuffer} buffer
|
|
124
|
-
* @param {PropertySet} value
|
|
125
|
-
*/
|
|
126
|
-
serialize(buffer, value) {
|
|
127
|
-
buffer.writeUTF8String(JSON.stringify(value.data));
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
*
|
|
132
|
-
* @param {BinaryBuffer} buffer
|
|
133
|
-
* @param {PropertySet} value
|
|
134
|
-
*/
|
|
135
|
-
deserialize(buffer, value) {
|
|
136
|
-
const string = buffer.readUTF8String();
|
|
137
|
-
|
|
138
|
-
value.data = JSON.parse(string);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
2
|
+
import PropertySet from "./PropertySet.js";
|
|
3
|
+
|
|
4
|
+
export class PropertySetSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
klass = PropertySet;
|
|
8
|
+
version = 0;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param {BinaryBuffer} buffer
|
|
13
|
+
* @param {PropertySet} value
|
|
14
|
+
*/
|
|
15
|
+
serialize(buffer, value) {
|
|
16
|
+
buffer.writeUTF8String(JSON.stringify(value.data));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param {BinaryBuffer} buffer
|
|
22
|
+
* @param {PropertySet} value
|
|
23
|
+
*/
|
|
24
|
+
deserialize(buffer, value) {
|
|
25
|
+
const string = buffer.readUTF8String();
|
|
26
|
+
|
|
27
|
+
value.data = JSON.parse(string);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
2
|
-
|
|
3
1
|
export const SerializationFlags = {
|
|
4
2
|
Transient: 1
|
|
5
3
|
};
|
|
@@ -69,29 +67,3 @@ SerializationMetadata.Transient = Object.freeze(transient);
|
|
|
69
67
|
SerializationMetadata.typeName = "SerializationMetadata";
|
|
70
68
|
|
|
71
69
|
|
|
72
|
-
export class SerializationMetadataSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
73
|
-
constructor() {
|
|
74
|
-
super();
|
|
75
|
-
|
|
76
|
-
this.klass = SerializationMetadata;
|
|
77
|
-
this.version = 0;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
* @param {BinaryBuffer} buffer
|
|
83
|
-
* @param {SerializationMetadata} value
|
|
84
|
-
*/
|
|
85
|
-
serialize(buffer, value) {
|
|
86
|
-
buffer.writeUint8(value.flags);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
*
|
|
91
|
-
* @param {BinaryBuffer} buffer
|
|
92
|
-
* @param {SerializationMetadata} value
|
|
93
|
-
*/
|
|
94
|
-
deserialize(buffer, value) {
|
|
95
|
-
value.flags = buffer.readUint8();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
2
|
+
import { SerializationMetadata } from "./SerializationMetadata.js";
|
|
3
|
+
|
|
4
|
+
export class SerializationMetadataSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
5
|
+
|
|
6
|
+
klass = SerializationMetadata;
|
|
7
|
+
version = 0;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {BinaryBuffer} buffer
|
|
12
|
+
* @param {SerializationMetadata} value
|
|
13
|
+
*/
|
|
14
|
+
serialize(buffer, value) {
|
|
15
|
+
buffer.writeUint8(value.flags);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param {BinaryBuffer} buffer
|
|
21
|
+
* @param {SerializationMetadata} value
|
|
22
|
+
*/
|
|
23
|
+
deserialize(buffer, value) {
|
|
24
|
+
value.flags = buffer.readUint8();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
import Vector3 from '../../../core/geom/Vector3.js';
|
|
9
|
-
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* @readonly
|
|
@@ -110,37 +109,3 @@ Steering.typeName = "Steering";
|
|
|
110
109
|
|
|
111
110
|
export default Steering;
|
|
112
111
|
|
|
113
|
-
export class SteeringSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
114
|
-
constructor() {
|
|
115
|
-
super();
|
|
116
|
-
|
|
117
|
-
this.klass = Steering;
|
|
118
|
-
this.version = 0;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
*
|
|
123
|
-
* @param {BinaryBuffer} buffer
|
|
124
|
-
* @param {Steering} value
|
|
125
|
-
*/
|
|
126
|
-
serialize(buffer, value) {
|
|
127
|
-
buffer.writeFloat32(value.maxSpeed);
|
|
128
|
-
buffer.writeFloat32(value.rotationSpeed);
|
|
129
|
-
|
|
130
|
-
value.destination.toBinaryBufferFloat32(buffer);
|
|
131
|
-
value.targetMargin.toBinaryBufferFloat32_EqualityEncoded(buffer);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
*
|
|
136
|
-
* @param {BinaryBuffer} buffer
|
|
137
|
-
* @param {Steering} value
|
|
138
|
-
*/
|
|
139
|
-
deserialize(buffer, value) {
|
|
140
|
-
value.maxSpeed = buffer.readFloat32();
|
|
141
|
-
value.rotationSpeed = buffer.readFloat32();
|
|
142
|
-
|
|
143
|
-
value.destination.fromBinaryBufferFloat32(buffer);
|
|
144
|
-
value.targetMargin.fromBinaryBufferFloat32_EqualityEncoded(buffer);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
2
|
+
import Steering from "./Steering.js";
|
|
3
|
+
|
|
4
|
+
export class SteeringSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
5
|
+
|
|
6
|
+
klass = Steering;
|
|
7
|
+
version = 0;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {BinaryBuffer} buffer
|
|
12
|
+
* @param {Steering} value
|
|
13
|
+
*/
|
|
14
|
+
serialize(buffer, value) {
|
|
15
|
+
buffer.writeFloat32(value.maxSpeed);
|
|
16
|
+
buffer.writeFloat32(value.rotationSpeed);
|
|
17
|
+
|
|
18
|
+
value.destination.toBinaryBufferFloat32(buffer);
|
|
19
|
+
value.targetMargin.toBinaryBufferFloat32_EqualityEncoded(buffer);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {BinaryBuffer} buffer
|
|
25
|
+
* @param {Steering} value
|
|
26
|
+
*/
|
|
27
|
+
deserialize(buffer, value) {
|
|
28
|
+
value.maxSpeed = buffer.readFloat32();
|
|
29
|
+
value.rotationSpeed = buffer.readFloat32();
|
|
30
|
+
|
|
31
|
+
value.destination.fromBinaryBufferFloat32(buffer);
|
|
32
|
+
value.targetMargin.fromBinaryBufferFloat32_EqualityEncoded(buffer);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -3,32 +3,18 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
7
|
-
import { BinaryClassUpgrader } from "../storage/binary/BinaryClassUpgrader.js";
|
|
8
6
|
import { computeStringHash } from "../../../core/primitives/strings/computeStringHash.js";
|
|
9
7
|
import { assert } from "../../../core/assert.js";
|
|
10
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Stores textual tags, useful for marking entities
|
|
11
|
+
*/
|
|
11
12
|
export class Tag {
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
15
|
-
* @constructor
|
|
14
|
+
* @private
|
|
15
|
+
* @type {String[]}
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @private
|
|
21
|
-
* @type {String[]}
|
|
22
|
-
*/
|
|
23
|
-
this.values = [];
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (name !== undefined) {
|
|
27
|
-
this.add(name);
|
|
28
|
-
|
|
29
|
-
console.warn('constructor arguments are deprecated');
|
|
30
|
-
}
|
|
31
|
-
}
|
|
17
|
+
values = [];
|
|
32
18
|
|
|
33
19
|
/**
|
|
34
20
|
*
|
|
@@ -49,27 +35,6 @@ export class Tag {
|
|
|
49
35
|
return this.values[i];
|
|
50
36
|
}
|
|
51
37
|
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
54
|
-
* @param {String} v
|
|
55
|
-
*/
|
|
56
|
-
set name(v) {
|
|
57
|
-
console.warn('name property is deprecated');
|
|
58
|
-
|
|
59
|
-
this.clear();
|
|
60
|
-
this.add(v);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
* @returns {String}
|
|
66
|
-
*/
|
|
67
|
-
get name() {
|
|
68
|
-
console.warn('name property is deprecated');
|
|
69
|
-
|
|
70
|
-
return this.getFirst();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
38
|
clear() {
|
|
74
39
|
this.values.splice(0, this.values.length);
|
|
75
40
|
}
|
|
@@ -327,65 +292,4 @@ Tag.typeName = "Tag";
|
|
|
327
292
|
|
|
328
293
|
export default Tag;
|
|
329
294
|
|
|
330
|
-
export class TagSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
331
|
-
constructor() {
|
|
332
|
-
super();
|
|
333
|
-
|
|
334
|
-
this.klass = Tag;
|
|
335
|
-
this.version = 1;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
*
|
|
340
|
-
* @param {BinaryBuffer} buffer
|
|
341
|
-
* @param {Tag} value
|
|
342
|
-
*/
|
|
343
|
-
serialize(buffer, value) {
|
|
344
|
-
const values = value.getValues();
|
|
345
|
-
|
|
346
|
-
const n = values.length;
|
|
347
|
-
|
|
348
|
-
buffer.writeUintVar(n);
|
|
349
|
-
|
|
350
|
-
for (let i = 0; i < n; i++) {
|
|
351
|
-
const v = values[i];
|
|
352
|
-
|
|
353
|
-
buffer.writeUTF8String(v);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
*
|
|
359
|
-
* @param {BinaryBuffer} buffer
|
|
360
|
-
* @param {Tag} value
|
|
361
|
-
*/
|
|
362
|
-
deserialize(buffer, value) {
|
|
363
|
-
value.clear();
|
|
364
|
-
|
|
365
|
-
const tagCount = buffer.readUintVar();
|
|
366
|
-
|
|
367
|
-
for (let i = 0; i < tagCount; i++) {
|
|
368
|
-
const v = buffer.readUTF8String();
|
|
369
|
-
|
|
370
|
-
value.add(v);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
export class TagSerializationUpgrader_0_1 extends BinaryClassUpgrader {
|
|
377
|
-
constructor() {
|
|
378
|
-
super();
|
|
379
|
-
|
|
380
|
-
this.__startVersion = 0;
|
|
381
|
-
this.__targetVersion = 1;
|
|
382
|
-
}
|
|
383
295
|
|
|
384
|
-
upgrade(source, target) {
|
|
385
|
-
const tag = source.readUTF8String();
|
|
386
|
-
|
|
387
|
-
//write tag count
|
|
388
|
-
target.writeUintVar(1);
|
|
389
|
-
target.writeUTF8String(tag);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
2
|
+
import Tag from "./Tag.js";
|
|
3
|
+
|
|
4
|
+
export class TagSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
5
|
+
|
|
6
|
+
klass = Tag;
|
|
7
|
+
version = 1;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {BinaryBuffer} buffer
|
|
12
|
+
* @param {Tag} value
|
|
13
|
+
*/
|
|
14
|
+
serialize(buffer, value) {
|
|
15
|
+
const values = value.getValues();
|
|
16
|
+
|
|
17
|
+
const n = values.length;
|
|
18
|
+
|
|
19
|
+
buffer.writeUintVar(n);
|
|
20
|
+
|
|
21
|
+
for (let i = 0; i < n; i++) {
|
|
22
|
+
const v = values[i];
|
|
23
|
+
|
|
24
|
+
buffer.writeUTF8String(v);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {BinaryBuffer} buffer
|
|
31
|
+
* @param {Tag} value
|
|
32
|
+
*/
|
|
33
|
+
deserialize(buffer, value) {
|
|
34
|
+
value.clear();
|
|
35
|
+
|
|
36
|
+
const tagCount = buffer.readUintVar();
|
|
37
|
+
|
|
38
|
+
for (let i = 0; i < tagCount; i++) {
|
|
39
|
+
const v = buffer.readUTF8String();
|
|
40
|
+
|
|
41
|
+
value.add(v);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BinaryClassUpgrader } from "../storage/binary/BinaryClassUpgrader.js";
|
|
2
|
+
|
|
3
|
+
export class TagSerializationUpgrader_0_1 extends BinaryClassUpgrader {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
|
|
7
|
+
this.__startVersion = 0;
|
|
8
|
+
this.__targetVersion = 1;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
upgrade(source, target) {
|
|
12
|
+
const tag = source.readUTF8String();
|
|
13
|
+
|
|
14
|
+
//write tag count
|
|
15
|
+
target.writeUintVar(1);
|
|
16
|
+
target.writeUTF8String(tag);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -12,7 +12,7 @@ import { DieBehavior } from "../../intelligence/behavior/ecs/DieBehavior.js";
|
|
|
12
12
|
import { SerializationMetadata } from "../components/SerializationMetadata.js";
|
|
13
13
|
import Tag from "../components/Tag.js";
|
|
14
14
|
import { OverrideContextBehavior } from "../../../../../model/game/util/behavior/OverrideContextBehavior.js";
|
|
15
|
-
import { HashMap } from "../../../core/collection/HashMap.js";
|
|
15
|
+
import { HashMap } from "../../../core/collection/map/HashMap.js";
|
|
16
16
|
import { assert } from "../../../core/assert.js";
|
|
17
17
|
import { RuleExecution } from "./RuleExecution.js";
|
|
18
18
|
import { computeContextualDynamicRuleDebugString } from "./rules/computeContextualDynamicRuleDebugString.js";
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { NumericInterval } from "../../../../core/math/interval/NumericInterval.js";
|
|
2
2
|
|
|
3
3
|
export class DynamicRuleCooldownDescription {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* @type {NumericInterval}
|
|
15
|
-
*/
|
|
16
|
-
this.value = new NumericInterval(0, 0);
|
|
17
|
-
}
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @type {string}
|
|
7
|
+
*/
|
|
8
|
+
id = "";
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @type {NumericInterval}
|
|
12
|
+
*/
|
|
13
|
+
value= new NumericInterval(0, 0);
|
|
18
14
|
|
|
19
15
|
fromJSON({ id, value }) {
|
|
20
16
|
|
|
@@ -7,45 +7,37 @@ import { deserializeActionFromJSON } from "../actions/definition/deserializeActi
|
|
|
7
7
|
import { DynamicRuleCooldownDescription } from "./DynamicRuleCooldownDescription.js";
|
|
8
8
|
|
|
9
9
|
export class DynamicRuleDescription {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.predicate_complexity = 0;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Specified which global cooldowns will be triggered and for how long
|
|
45
|
-
* @type {DynamicRuleCooldownDescription[]}
|
|
46
|
-
*/
|
|
47
|
-
this.cooldowns_global = [];
|
|
48
|
-
}
|
|
10
|
+
id = 0;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @type {ReactiveExpression}
|
|
14
|
+
*/
|
|
15
|
+
condition = null;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @type {AbstractActionDescription}
|
|
19
|
+
*/
|
|
20
|
+
action = null;
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @type {ReactiveReference[]}
|
|
24
|
+
*/
|
|
25
|
+
references = [];
|
|
26
|
+
/**
|
|
27
|
+
* Rules with higher priority have the right to interrupt lower priority rules
|
|
28
|
+
* @type {number}
|
|
29
|
+
*/
|
|
30
|
+
priority = 0;
|
|
31
|
+
/**
|
|
32
|
+
* @private
|
|
33
|
+
* @type {number}
|
|
34
|
+
*/
|
|
35
|
+
predicate_complexity = 0;
|
|
36
|
+
/**
|
|
37
|
+
* Specified which global cooldowns will be triggered and for how long
|
|
38
|
+
* @type {DynamicRuleCooldownDescription[]}
|
|
39
|
+
*/
|
|
40
|
+
cooldowns_global = [];
|
|
49
41
|
|
|
50
42
|
/**
|
|
51
43
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StaticKnowledgeDataTable } from "../../../knowledge/database/StaticKnowledgeDataTable.js";
|
|
2
2
|
import { DynamicRuleDescription } from "./DynamicRuleDescription.js";
|
|
3
3
|
import { MultiPredicateEvaluator } from "../../../../core/model/reactive/evaluation/MultiPredicateEvaluator.js";
|
|
4
|
-
import { HashMap } from "../../../../core/collection/HashMap.js";
|
|
4
|
+
import { HashMap } from "../../../../core/collection/map/HashMap.js";
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export class DynamicRuleDescriptionTable extends StaticKnowledgeDataTable {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { seededRandom } from "
|
|
2
|
-
import { DynamicRuleDescriptionTable } from "./
|
|
1
|
+
import { seededRandom } from "../../../../core/math/random/seededRandom.js";
|
|
2
|
+
import { DynamicRuleDescriptionTable } from "./DynamicRuleDescriptionTable.js";
|
|
3
3
|
import {
|
|
4
4
|
createRandomReactiveExpression
|
|
5
|
-
} from "
|
|
6
|
-
import { ReactiveReference } from "
|
|
7
|
-
import { ReactiveLiteralNumber } from "
|
|
8
|
-
import { ReactiveLiteralString } from "
|
|
9
|
-
import { ReactiveLiteralBoolean } from "
|
|
10
|
-
import { DynamicRuleDescription } from "./
|
|
11
|
-
import DataType from "
|
|
12
|
-
import { randomFromArray } from "
|
|
13
|
-
import { randomFloatBetween } from "
|
|
14
|
-
import { randomIntegerBetween } from "
|
|
5
|
+
} from "../../../../core/model/reactive/model/util/createRandomReactiveExpression.js";
|
|
6
|
+
import { ReactiveReference } from "../../../../core/model/reactive/model/terminal/ReactiveReference.js";
|
|
7
|
+
import { ReactiveLiteralNumber } from "../../../../core/model/reactive/model/terminal/ReactiveLiteralNumber.js";
|
|
8
|
+
import { ReactiveLiteralString } from "../../../../core/model/reactive/model/terminal/ReactiveLiteralString.js";
|
|
9
|
+
import { ReactiveLiteralBoolean } from "../../../../core/model/reactive/model/terminal/ReactiveLiteralBoolean.js";
|
|
10
|
+
import { DynamicRuleDescription } from "./DynamicRuleDescription.js";
|
|
11
|
+
import DataType from "../../../../core/parser/simple/DataType.js";
|
|
12
|
+
import { randomFromArray } from "../../../../core/math/random/randomFromArray.js";
|
|
13
|
+
import { randomFloatBetween } from "../../../../core/math/random/randomFloatBetween.js";
|
|
14
|
+
import { randomIntegerBetween } from "../../../../core/math/random/randomIntegerBetween.js";
|
|
15
15
|
|
|
16
16
|
describe.skip('performance', () => {
|
|
17
17
|
|
|
@@ -3,12 +3,9 @@ import { InstancedMeshComponent } from "./InstancedMeshComponent.js";
|
|
|
3
3
|
import { InstancedMeshLayer } from "./InstancedMeshLayer.js";
|
|
4
4
|
|
|
5
5
|
export class InstancedMeshSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
7
|
+
klass = InstancedMeshComponent;
|
|
8
|
+
version = 0;
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
*
|