@woosh/meep-engine 2.119.9 → 2.119.12
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/build/bundle-worker-terrain.js +1 -1
- package/package.json +1 -1
- package/src/core/color/hex/hex2rgb.js +1 -1
- package/src/core/color/operations/color_darken.d.ts +1 -0
- package/src/core/color/operations/color_darken.d.ts.map +1 -1
- package/src/core/color/operations/color_darken.js +1 -0
- package/src/core/color/operations/color_desaturate.d.ts +1 -0
- package/src/core/color/operations/color_desaturate.d.ts.map +1 -1
- package/src/core/color/operations/color_desaturate.js +1 -0
- package/src/core/color/operations/color_lerp.d.ts +11 -0
- package/src/core/color/operations/color_lerp.d.ts.map +1 -0
- package/src/core/color/operations/color_lerp.js +35 -0
- package/src/core/color/operations/color_lighten.d.ts +1 -0
- package/src/core/color/operations/color_lighten.d.ts.map +1 -1
- package/src/core/color/operations/color_lighten.js +1 -0
- package/src/core/color/operations/color_saturate.d.ts +1 -0
- package/src/core/color/operations/color_saturate.d.ts.map +1 -1
- package/src/core/color/operations/color_saturate.js +1 -0
- package/src/core/color/parse_color.d.ts.map +1 -1
- package/src/core/color/parse_color.js +2 -1
- package/src/core/debug/matchers/AllOf.d.ts.map +1 -1
- package/src/core/debug/matchers/AllOf.js +1 -1
- package/src/core/debug/matchers/IsAnything.d.ts +1 -1
- package/src/core/debug/matchers/IsAnything.d.ts.map +1 -1
- package/src/core/debug/matchers/IsAnything.js +1 -1
- package/src/core/debug/matchers/IsIn.d.ts +4 -1
- package/src/core/debug/matchers/IsIn.d.ts.map +1 -1
- package/src/core/debug/matchers/IsIn.js +3 -0
- package/src/core/debug/matchers/IsNot.d.ts +6 -3
- package/src/core/debug/matchers/IsNot.d.ts.map +1 -1
- package/src/core/debug/matchers/IsNot.js +6 -3
- package/src/core/debug/matchers/matchers.d.ts +3 -3
- package/src/core/debug/matchers/matchers.d.ts.map +1 -1
- package/src/core/debug/matchers/matchers.js +9 -9
- package/src/core/geom/3d/compute_triangle_normal.js +1 -1
- package/src/core/geom/3d/cone/computeConeBoundingBox.d.ts +1 -1
- package/src/core/geom/3d/cone/computeConeBoundingBox.d.ts.map +1 -1
- package/src/core/geom/3d/cone/computeConeBoundingBox.js +9 -2
- package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +2 -2
- package/src/core/geom/3d/ray/ray3_array_apply_matrix4.d.ts.map +1 -1
- package/src/core/geom/3d/ray/ray3_array_apply_matrix4.js +5 -35
- package/src/core/geom/3d/ray/{ray_computeNearestPointToPoint.d.ts → ray3_compute_nearest_point_to_point.d.ts} +2 -2
- package/src/core/geom/3d/ray/ray3_compute_nearest_point_to_point.d.ts.map +1 -0
- package/src/core/geom/3d/ray/{ray_computeNearestPointToPoint.js → ray3_compute_nearest_point_to_point.js} +2 -2
- package/src/core/geom/3d/ray/ray3_distance_to_point.d.ts +2 -0
- package/src/core/geom/3d/ray/ray3_distance_to_point.d.ts.map +1 -0
- package/src/core/geom/3d/ray/{ray_distance_to_point.js → ray3_distance_to_point.js} +2 -2
- package/src/core/geom/3d/topology/simplify/compute_face_normal_change_dot_product.js +1 -1
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts.map +1 -0
- package/src/core/geom/3d/{v3_compute_triangle_normal.js → triangle/v3_compute_triangle_normal.js} +1 -1
- package/src/core/geom/vec3/v3_negate_array.d.ts.map +1 -0
- package/src/core/math/random/randomFromArray.d.ts +2 -2
- package/src/core/math/random/randomFromArray.js +2 -2
- package/src/engine/EngineBootstrapper.d.ts.map +1 -1
- package/src/engine/EngineBootstrapper.js +6 -8
- package/src/engine/EngineConfiguration.d.ts.map +1 -1
- package/src/engine/EngineConfiguration.js +3 -0
- package/src/engine/ecs/Entity.d.ts.map +1 -1
- package/src/engine/ecs/Entity.js +1 -1
- package/src/engine/ecs/dynamic_actions/DataScope.d.ts +36 -0
- package/src/engine/ecs/dynamic_actions/DataScope.d.ts.map +1 -0
- package/src/engine/ecs/dynamic_actions/DataScope.js +126 -0
- package/src/engine/ecs/dynamic_actions/DynamicActorSystem.d.ts +1 -1
- package/src/engine/ecs/dynamic_actions/DynamicActorSystem.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +2 -2
- package/src/engine/ecs/dynamic_actions/RuleExecution.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/RuleExecution.js +1 -1
- package/src/engine/graphics/geometry/geometry_construct_triangle_normal.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.js +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +13 -25
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts +13 -0
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts.map +1 -0
- package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js +35 -0
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts.map +1 -1
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.js +4 -0
- package/src/engine/physics/gjk/expanding_polytope_algorithm.js +2 -2
- package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.js +11 -6
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +4 -4
- package/src/engine/sound/ecs/emitter/SoundTrack.d.ts +9 -3
- package/src/engine/sound/ecs/emitter/SoundTrack.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundTrack.js +17 -1
- package/src/generation/filtering/numeric/complex/CellFilterCurvature.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterCurvature.js +4 -5
- package/src/generation/filtering/numeric/math/poly/CellFilterCubicFunction.d.ts.map +1 -1
- package/src/generation/filtering/numeric/math/poly/CellFilterCubicFunction.js +5 -9
- package/src/view/tooltip/DomTooltipManager.d.ts.map +1 -1
- package/src/view/tooltip/DomTooltipManager.js +2 -0
- package/src/view/tooltip/TooltipManager.d.ts +9 -0
- package/src/view/tooltip/TooltipManager.d.ts.map +1 -1
- package/src/view/tooltip/TooltipManager.js +27 -16
- package/src/core/geom/2d/shape/AbstractShape.d.ts +0 -31
- package/src/core/geom/2d/shape/AbstractShape.d.ts.map +0 -1
- package/src/core/geom/2d/shape/AbstractShape.js +0 -51
- package/src/core/geom/2d/shape/CircleShape.d.ts +0 -47
- package/src/core/geom/2d/shape/CircleShape.d.ts.map +0 -1
- package/src/core/geom/2d/shape/CircleShape.js +0 -109
- package/src/core/geom/2d/shape/PointShape.d.ts +0 -21
- package/src/core/geom/2d/shape/PointShape.d.ts.map +0 -1
- package/src/core/geom/2d/shape/PointShape.js +0 -34
- package/src/core/geom/2d/shape/Shape2DType.d.ts +0 -7
- package/src/core/geom/2d/shape/Shape2DType.d.ts.map +0 -1
- package/src/core/geom/2d/shape/Shape2DType.js +0 -9
- package/src/core/geom/3d/ray/ray_computeNearestPointToPoint.d.ts.map +0 -1
- package/src/core/geom/3d/ray/ray_distance_to_point.d.ts +0 -2
- package/src/core/geom/3d/ray/ray_distance_to_point.d.ts.map +0 -1
- package/src/core/geom/3d/v3_compute_triangle_normal.d.ts.map +0 -1
- package/src/core/geom/3d/v3_negate_array.d.ts.map +0 -1
- package/src/core/math/random/seededRandom_sine.d.ts +0 -2
- package/src/core/math/random/seededRandom_sine.d.ts.map +0 -1
- package/src/core/math/random/seededRandom_sine.js +0 -33
- /package/src/core/geom/3d/{v3_compute_triangle_normal.d.ts → triangle/v3_compute_triangle_normal.d.ts} +0 -0
- /package/src/core/geom/{3d → vec3}/v3_negate_array.d.ts +0 -0
- /package/src/core/geom/{3d → vec3}/v3_negate_array.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v3_array_matrix4_rotate } from "../../vec3/v3_array_matrix4_rotate.js";
|
|
2
|
+
import { v3_matrix4_multiply } from "../../vec3/v3_matrix4_multiply.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
*
|
|
@@ -10,14 +11,11 @@ import { v3_length } from "../../vec3/v3_length.js";
|
|
|
10
11
|
* @returns {boolean} false if matrix transformation is impossible, such as when scale of the matrix is 0
|
|
11
12
|
*/
|
|
12
13
|
export function ray3_array_apply_matrix4(output, output_offset, input, input_offset, m4) {
|
|
14
|
+
|
|
13
15
|
const origin_x = input[input_offset + 0];
|
|
14
16
|
const origin_y = input[input_offset + 1];
|
|
15
17
|
const origin_z = input[input_offset + 2];
|
|
16
18
|
|
|
17
|
-
const direction_x = input[input_offset + 3];
|
|
18
|
-
const direction_y = input[input_offset + 4];
|
|
19
|
-
const direction_z = input[input_offset + 5];
|
|
20
|
-
|
|
21
19
|
// transform ray to local space (inlined for speed)
|
|
22
20
|
const det = m4[3] * origin_x + m4[7] * origin_y + m4[11] * origin_z + m4[15];
|
|
23
21
|
|
|
@@ -25,36 +23,8 @@ export function ray3_array_apply_matrix4(output, output_offset, input, input_off
|
|
|
25
23
|
return false;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const out_origin_x = (m4[0] * origin_x + m4[4] * origin_y + m4[8] * origin_z + m4[12]) * inv_w;
|
|
31
|
-
const out_origin_y = (m4[1] * origin_x + m4[5] * origin_y + m4[9] * origin_z + m4[13]) * inv_w;
|
|
32
|
-
const out_origin_z = (m4[2] * origin_x + m4[6] * origin_y + m4[10] * origin_z + m4[14]) * inv_w;
|
|
33
|
-
|
|
34
|
-
const out_direction_x = m4[0] * direction_x + m4[4] * direction_y + m4[8] * direction_z;
|
|
35
|
-
const out_direction_y = m4[1] * direction_x + m4[5] * direction_y + m4[9] * direction_z;
|
|
36
|
-
const out_direction_z = m4[2] * direction_x + m4[6] * direction_y + m4[10] * direction_z;
|
|
37
|
-
|
|
38
|
-
// normalize direction
|
|
39
|
-
const out_direction_magnitude = v3_length(out_direction_x, out_direction_y, out_direction_z);
|
|
40
|
-
|
|
41
|
-
if (out_direction_magnitude === 0) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const out_direction_magnitude_inverse = 1 / out_direction_magnitude;
|
|
46
|
-
|
|
47
|
-
const out_direction_normalized_x = out_direction_x * out_direction_magnitude_inverse;
|
|
48
|
-
const out_direction_normalized_y = out_direction_y * out_direction_magnitude_inverse;
|
|
49
|
-
const out_direction_normalized_z = out_direction_z * out_direction_magnitude_inverse;
|
|
50
|
-
|
|
51
|
-
output[output_offset + 0] = out_origin_x;
|
|
52
|
-
output[output_offset + 1] = out_origin_y;
|
|
53
|
-
output[output_offset + 2] = out_origin_z;
|
|
54
|
-
|
|
55
|
-
output[output_offset + 3] = out_direction_normalized_x;
|
|
56
|
-
output[output_offset + 4] = out_direction_normalized_y;
|
|
57
|
-
output[output_offset + 5] = out_direction_normalized_z;
|
|
26
|
+
v3_matrix4_multiply(output, output_offset, input, input_offset, m4);
|
|
27
|
+
v3_array_matrix4_rotate(output, output_offset + 3, input, input_offset + 3, m4);
|
|
58
28
|
|
|
59
29
|
return true;
|
|
60
30
|
}
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* @param {number} pz
|
|
13
13
|
* @returns {number} distance from origin, negative means that the point lies behind the origin in the direction opposite to the ray's own
|
|
14
14
|
*/
|
|
15
|
-
export function
|
|
16
|
-
//# sourceMappingURL=
|
|
15
|
+
export function ray3_compute_nearest_point_to_point(result: Vector3, origin_x: number, origin_y: number, origin_z: number, direction_x: number, direction_y: number, direction_z: number, px: number, py: number, pz: number): number;
|
|
16
|
+
//# sourceMappingURL=ray3_compute_nearest_point_to_point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ray3_compute_nearest_point_to_point.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/ray/ray3_compute_nearest_point_to_point.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,+EAXW,MAAM,YACN,MAAM,YACN,MAAM,eACN,MAAM,eACN,MAAM,eACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CA4BlB"}
|
|
@@ -14,14 +14,14 @@ import { v3_dot } from "../../vec3/v3_dot.js";
|
|
|
14
14
|
* @param {number} pz
|
|
15
15
|
* @returns {number} distance from origin, negative means that the point lies behind the origin in the direction opposite to the ray's own
|
|
16
16
|
*/
|
|
17
|
-
export function
|
|
17
|
+
export function ray3_compute_nearest_point_to_point(
|
|
18
18
|
result,
|
|
19
19
|
origin_x, origin_y, origin_z,
|
|
20
20
|
direction_x, direction_y, direction_z,
|
|
21
21
|
px, py, pz
|
|
22
22
|
) {
|
|
23
23
|
|
|
24
|
-
// find closest point
|
|
24
|
+
// find the closest point
|
|
25
25
|
const sp0_x = px - origin_x;
|
|
26
26
|
const sp0_y = py - origin_y;
|
|
27
27
|
const sp0_z = pz - origin_z;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ray3_distance_to_point.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/ray/ray3_distance_to_point.js"],"names":[],"mappings":"AAEA,sLAWC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { v3_dot } from "../../vec3/v3_dot.js";
|
|
2
2
|
|
|
3
|
-
export function
|
|
4
|
-
// find closest point
|
|
3
|
+
export function ray3_distance_to_point(origin_x, origin_y, origin_z, direction_x, direction_y, direction_z, ref_x, ref_y, ref_z){
|
|
4
|
+
// find the closest point
|
|
5
5
|
const sp0_x = ref_x - origin_x;
|
|
6
6
|
const sp0_y = ref_y - origin_y;
|
|
7
7
|
const sp0_z = ref_z - origin_z;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v3_dot } from "../../../vec3/v3_dot.js";
|
|
2
|
-
import { v3_compute_triangle_normal } from "../../v3_compute_triangle_normal.js";
|
|
2
|
+
import { v3_compute_triangle_normal } from "../../triangle/v3_compute_triangle_normal.js";
|
|
3
3
|
|
|
4
4
|
const scratch_normal = new Float32Array(6);
|
|
5
5
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3_compute_triangle_normal.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/triangle/v3_compute_triangle_normal.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,mDAZW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,QA0ChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3_negate_array.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_negate_array.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wCALW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,SACN,MAAM,EAAE,GAAC,YAAY,gBACrB,MAAM,QAUhB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @template T
|
|
3
|
-
* @param {function} random
|
|
3
|
+
* @param {function} random if you don't have a custom RNG, you can always pass {@link Math.random} instead
|
|
4
4
|
* @param {T[]} array
|
|
5
|
-
* @returns {T}
|
|
5
|
+
* @returns {T|undefined} returns undefined only if that value is in the array or if array is empty
|
|
6
6
|
*/
|
|
7
7
|
export function randomFromArray<T>(random: Function, array: T[]): T;
|
|
8
8
|
//# sourceMappingURL=randomFromArray.d.ts.map
|
|
@@ -3,9 +3,9 @@ import { randomIntegerBetween } from "./randomIntegerBetween.js";
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @template T
|
|
6
|
-
* @param {function} random
|
|
6
|
+
* @param {function} random if you don't have a custom RNG, you can always pass {@link Math.random} instead
|
|
7
7
|
* @param {T[]} array
|
|
8
|
-
* @returns {T}
|
|
8
|
+
* @returns {T|undefined} returns undefined only if that value is in the array or if array is empty
|
|
9
9
|
*/
|
|
10
10
|
export function randomFromArray(random, array) {
|
|
11
11
|
assert.isArray(array, 'array');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EngineBootstrapper.d.ts","sourceRoot":"","sources":["../../../src/engine/EngineBootstrapper.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;
|
|
1
|
+
{"version":3,"file":"EngineBootstrapper.d.ts","sourceRoot":"","sources":["../../../src/engine/EngineBootstrapper.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAEI;;;OAGG;IACH,UAFU,IAAI,CAEE;IAGhB;;;;OAIG;IACH,mCA8CC;CACJ"}
|
|
@@ -5,14 +5,12 @@ import LabelView from "../view/common/LabelView.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export class EngineBootstrapper {
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @type {Node}
|
|
11
|
+
*/
|
|
12
|
+
rootNode = null;
|
|
13
|
+
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
16
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EngineConfiguration.d.ts","sourceRoot":"","sources":["../../../src/engine/EngineConfiguration.js"],"names":[],"mappings":"AAGA;IAEI;;;OAGG;IACH,gBAAa;IAEb;;;OAGG;IACH,gBAAa;IAEb;;;OAGG;IACH,kBAAe;IAEf;;;OAGG;IACH,SAFU,IAAI,MAAM,mBAAkB,CAElB;IAEpB;;;;OAIG;IACH,gBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,mBAHW,MAAM,mCAWhB;IAED;;;;OAIG;IACH,wBAHW,MAAM,oBAWhB;IAED;;;;OAIG;IACH,wCAFa,OAAO,CAQnB;IAED;;;;OAIG;IACH,2BAFa,OAAO,CAUnB;IAED;;OAEG;IACH,yCAKC;IAED;;;;OAIG;IACH,yDAFa,OAAO,
|
|
1
|
+
{"version":3,"file":"EngineConfiguration.d.ts","sourceRoot":"","sources":["../../../src/engine/EngineConfiguration.js"],"names":[],"mappings":"AAGA;IAEI;;;OAGG;IACH,gBAAa;IAEb;;;OAGG;IACH,gBAAa;IAEb;;;OAGG;IACH,kBAAe;IAEf;;;OAGG;IACH,SAFU,IAAI,MAAM,mBAAkB,CAElB;IAEpB;;;;OAIG;IACH,gBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,mBAHW,MAAM,mCAWhB;IAED;;;;OAIG;IACH,wBAHW,MAAM,oBAWhB;IAED;;;;OAIG;IACH,wCAFa,OAAO,CAQnB;IAED;;;;OAIG;IACH,2BAFa,OAAO,CAUnB;IAED;;OAEG;IACH,yCAKC;IAED;;;;OAIG;IACH,yDAFa,OAAO,CASnB;IAED;;;OAGG;IACH,qCAmDC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/Entity.js"],"names":[],"mappings":";AAeA;;;GAGG;AACH;IAoYI;;;;;OAKG;IACH,+BAJW,MAAM,oCAEJ,MAAM,CAelB;IArZD;;;OAGG;IACH,IAFU,MAAM,CAER;IAER;;;;OAIG;IACH,YAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,2BAAgB;IAQhB;;;OAGG;IACH,gCAAe;IAEf;;;OAGG;IACH,OAFU,WAAW,GAAC,MAAM,CAEN;IAEtB;;;OAGG;IACH,gBAAgB;IAEhB;;OAEG;IACH;;MAEE;IAUF;;;OAGG;IACH,eAFW,MAAM,GAAC,WAAW,QAI5B;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,WAAW,GAChB,OAAO,CAMnB;IAED;;;OAGG;IACH,gBAFW,MAAM,GAAC,WAAW,QAI5B;IAED;;;OAGG;IACH,uBAEC;IAED;;OAEG;IACH,4BAQC;IAED;;;OAGG;IACH,oBAEC;IAED;;;;OAIG;IACH,8BAFa,MAAM,CAiBlB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,0CAYC;IAED;;;;;OAKG;IACH,8CAQC;IAED;;;;OAIG;IACH,kCAFa,MAAE,IAAI,CA0BlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,qBAShB;IAED;;;OAGG;IACH,wBAFW,MAAM,gBAiBhB;IAED;;;;;;OAMG;IACH,4BALW,MAAM,sCAGJ,MAAM,CAalB;IAED;;;;;;OAMG;IACH,+BALW,MAAM,sCAGJ,MAAM,CAyBlB;IAED;;;OAGG;IACH,WAFa,OAAO,CAwBnB;IAED;;;;OAIG;IACH
|
|
1
|
+
{"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../../../src/engine/ecs/Entity.js"],"names":[],"mappings":";AAeA;;;GAGG;AACH;IAoYI;;;;;OAKG;IACH,+BAJW,MAAM,oCAEJ,MAAM,CAelB;IArZD;;;OAGG;IACH,IAFU,MAAM,CAER;IAER;;;;OAIG;IACH,YAFU,MAAM,CAEA;IAEhB;;;;OAIG;IACH,2BAAgB;IAQhB;;;OAGG;IACH,gCAAe;IAEf;;;OAGG;IACH,OAFU,WAAW,GAAC,MAAM,CAEN;IAEtB;;;OAGG;IACH,gBAAgB;IAEhB;;OAEG;IACH;;MAEE;IAUF;;;OAGG;IACH,eAFW,MAAM,GAAC,WAAW,QAI5B;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,WAAW,GAChB,OAAO,CAMnB;IAED;;;OAGG;IACH,gBAFW,MAAM,GAAC,WAAW,QAI5B;IAED;;;OAGG;IACH,uBAEC;IAED;;OAEG;IACH,4BAQC;IAED;;;OAGG;IACH,oBAEC;IAED;;;;OAIG;IACH,8BAFa,MAAM,CAiBlB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,0CAYC;IAED;;;;;OAKG;IACH,8CAQC;IAED;;;;OAIG;IACH,kCAFa,MAAE,IAAI,CA0BlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,qBAShB;IAED;;;OAGG;IACH,wBAFW,MAAM,gBAiBhB;IAED;;;;;;OAMG;IACH,4BALW,MAAM,sCAGJ,MAAM,CAalB;IAED;;;;;;OAMG;IACH,+BALW,MAAM,sCAGJ,MAAM,CAyBlB;IAED;;;OAGG;IACH,WAFa,OAAO,CAwBnB;IAED;;;;OAIG;IACH,wCAHa,MAAM,CAwDlB;IAwBL;;;;OAIG;IACH,mBAFU,OAAO,CAEQ;;CAPxB;4BAxa2B,kBAAkB;mBAF3B,oCAAoC"}
|
package/src/engine/ecs/Entity.js
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export class DataScope {
|
|
2
|
+
/**
|
|
3
|
+
* @private
|
|
4
|
+
* @type {Object[]}
|
|
5
|
+
*/
|
|
6
|
+
private stack;
|
|
7
|
+
proxy: this;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @return {number}
|
|
11
|
+
*/
|
|
12
|
+
size(): number;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {string} variableName
|
|
16
|
+
* @returns {*|undefined}
|
|
17
|
+
*/
|
|
18
|
+
read(variableName: string): any | undefined;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param {Object} scope
|
|
22
|
+
*/
|
|
23
|
+
push(scope: any): void;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @returns {Object}
|
|
27
|
+
*/
|
|
28
|
+
pop(): any;
|
|
29
|
+
/**
|
|
30
|
+
* Drop multiple frames from the top of the stack until stack size matches given value
|
|
31
|
+
* @param {number} size
|
|
32
|
+
* @returns {number} how many frames were dropped
|
|
33
|
+
*/
|
|
34
|
+
unwind(size: number): number;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=DataScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataScope.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/dynamic_actions/DataScope.js"],"names":[],"mappings":"AAEA;IAGQ;;;OAGG;IACH,cAAe;IAGf,YAqCE;IAGN;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,MAAE,SAAS,CAqBvB;IAED;;;OAGG;IACH,uBAOC;IAED;;;OAGG;IACH,WAIC;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,MAAM,CAYlB;CACJ"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
|
|
3
|
+
export class DataScope {
|
|
4
|
+
constructor() {
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
* @type {Object[]}
|
|
9
|
+
*/
|
|
10
|
+
this.stack = [];
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
this.proxy = new Proxy(this, {
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param target
|
|
17
|
+
* @param {string} p
|
|
18
|
+
* @param receiver
|
|
19
|
+
* @returns {*}
|
|
20
|
+
*/
|
|
21
|
+
get(target, p, receiver) {
|
|
22
|
+
return target.read(p);
|
|
23
|
+
},
|
|
24
|
+
ownKeys(target) {
|
|
25
|
+
const size = target.size();
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @type {string[]}
|
|
30
|
+
*/
|
|
31
|
+
const result = [];
|
|
32
|
+
|
|
33
|
+
for (let i = 0; i < size; i++) {
|
|
34
|
+
const frame = target.stack[i];
|
|
35
|
+
|
|
36
|
+
const keys = Reflect.ownKeys(frame);
|
|
37
|
+
|
|
38
|
+
const n = keys.length;
|
|
39
|
+
for (let j = 0; j < n; j++) {
|
|
40
|
+
const key = keys[j];
|
|
41
|
+
|
|
42
|
+
if (!result.includes(key)) {
|
|
43
|
+
result.push(key);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @return {number}
|
|
56
|
+
*/
|
|
57
|
+
size() {
|
|
58
|
+
return this.stack.length;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @param {string} variableName
|
|
64
|
+
* @returns {*|undefined}
|
|
65
|
+
*/
|
|
66
|
+
read(variableName) {
|
|
67
|
+
assert.typeOf(variableName, 'string', 'variableName');
|
|
68
|
+
|
|
69
|
+
const stack = this.stack;
|
|
70
|
+
|
|
71
|
+
const last = stack.length - 1;
|
|
72
|
+
|
|
73
|
+
for (let i = last; i >= 0; i--) {
|
|
74
|
+
const scope = stack[i];
|
|
75
|
+
|
|
76
|
+
const value = scope[variableName];
|
|
77
|
+
|
|
78
|
+
if (value !== undefined) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//not found
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @param {Object} scope
|
|
90
|
+
*/
|
|
91
|
+
push(scope) {
|
|
92
|
+
assert.notEqual(scope, undefined, 'scope is undefined');
|
|
93
|
+
assert.notEqual(scope, null, 'scope is null');
|
|
94
|
+
|
|
95
|
+
assert.typeOf(scope, 'object', 'scope');
|
|
96
|
+
|
|
97
|
+
this.stack.push(scope);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* @returns {Object}
|
|
103
|
+
*/
|
|
104
|
+
pop() {
|
|
105
|
+
assert.ok(this.stack.length > 0, 'Stack is empty');
|
|
106
|
+
|
|
107
|
+
return this.stack.pop();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Drop multiple frames from the top of the stack until stack size matches given value
|
|
112
|
+
* @param {number} size
|
|
113
|
+
* @returns {number} how many frames were dropped
|
|
114
|
+
*/
|
|
115
|
+
unwind(size) {
|
|
116
|
+
const top = this.size();
|
|
117
|
+
|
|
118
|
+
const count = top - size;
|
|
119
|
+
|
|
120
|
+
for (let i = 0; i < count; i++) {
|
|
121
|
+
this.pop();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return count;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -123,6 +123,6 @@ import { AbstractContextSystem } from "../system/AbstractContextSystem.js";
|
|
|
123
123
|
import { DynamicActor } from "./DynamicActor.js";
|
|
124
124
|
import { Blackboard } from "../../intelligence/blackboard/Blackboard.js";
|
|
125
125
|
import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessSpecification.js";
|
|
126
|
-
import { DataScope } from "
|
|
126
|
+
import { DataScope } from "./DataScope.js";
|
|
127
127
|
import { returnTrue } from "../../../core/function/returnTrue.js";
|
|
128
128
|
//# sourceMappingURL=DynamicActorSystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicActorSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/dynamic_actions/DynamicActorSystem.js"],"names":[],"mappings":"AA6FA;IA4DI;;;OAGG;IACH,4BASC;IAxED,sCAA8B;IAE9B,kEAEE;IAEF;;;OAGG;IACH,sCAAgB;IAEhB;;;OAGG;IACH,OAFU,SAAS,CAEK;IAExB;;;;OAIG;IACH,iCAOG;IAEH;;;;OAIG;IACH,gCAAoC;IAEpC;;;OAGG;IACH,mCAAiB;IAEjB;;;;OAIG;IACH,uBAAmB;IAEnB;;;;OAIG;IACH,gBAAgB;IASZ;;;OAGG;IACH,eAAoB;IAIxB;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAED;;;;;OAKG;IACH,6BAJW,MAAM,uDAyBhB;IAED;;;OAGG;IACH,iCAFW,MAAM,QAehB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,oDA4DhB;IAED;;;;OAIG;IACH,4BAHW,MAAM,SACN,SAAS,QAsDnB;IAED;;;;OAIG;IACH,yBAFY,yBAAuB,SAAS,CA6E3C;IAED;;;;;;;;;OASG;IACH,yFAHW,MAAM,GACJ;QAAC,MAAM,EAAC,MAAM,CAAC;QAAA,IAAI,yBAAwB;QAAC,KAAK,EAAE,SAAS,CAAA;KAAC,EAAE,CA4E3E;IAED;;;;;;OAMG;IACH,cALW,MAAM,SACN,MAAM,iBAEJ,yBAAuB,SAAS,CAiC5C;IAED,mFAWC;IAED;;;;;OAKG;IACH,mCAiBC;IAED,6BAYC;CACJ;
|
|
1
|
+
{"version":3,"file":"DynamicActorSystem.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/dynamic_actions/DynamicActorSystem.js"],"names":[],"mappings":"AA6FA;IA4DI;;;OAGG;IACH,4BASC;IAxED,sCAA8B;IAE9B,kEAEE;IAEF;;;OAGG;IACH,sCAAgB;IAEhB;;;OAGG;IACH,OAFU,SAAS,CAEK;IAExB;;;;OAIG;IACH,iCAOG;IAEH;;;;OAIG;IACH,gCAAoC;IAEpC;;;OAGG;IACH,mCAAiB;IAEjB;;;;OAIG;IACH,uBAAmB;IAEnB;;;;OAIG;IACH,gBAAgB;IASZ;;;OAGG;IACH,eAAoB;IAIxB;;;OAGG;IACH,kBAFY,MAAM,CAIjB;IAED;;;;;OAKG;IACH,6BAJW,MAAM,uDAyBhB;IAED;;;OAGG;IACH,iCAFW,MAAM,QAehB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,oDA4DhB;IAED;;;;OAIG;IACH,4BAHW,MAAM,SACN,SAAS,QAsDnB;IAED;;;;OAIG;IACH,yBAFY,yBAAuB,SAAS,CA6E3C;IAED;;;;;;;;;OASG;IACH,yFAHW,MAAM,GACJ;QAAC,MAAM,EAAC,MAAM,CAAC;QAAA,IAAI,yBAAwB;QAAC,KAAK,EAAE,SAAS,CAAA;KAAC,EAAE,CA4E3E;IAED;;;;;;OAMG;IACH,cALW,MAAM,SACN,MAAM,iBAEJ,yBAAuB,SAAS,CAiC5C;IAED,mFAWC;IAED;;;;;OAKG;IACH,mCAiBC;IAED,6BAYC;CACJ;sCAzkBqC,oCAAoC;6BAG7C,mBAAmB;2BATrB,6CAA6C;4CAP5B,oDAAoD;0BAetE,gBAAgB;2BAnBf,sCAAsC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { DataScope } from "../../../../../model/game/unit/actions/data/DataScope.js";
|
|
2
|
-
import { OverrideContextBehavior } from "../../../../../model/game/util/behavior/OverrideContextBehavior.js";
|
|
3
1
|
import { assert } from "../../../core/assert.js";
|
|
4
2
|
import { randomMultipleFromArray } from "../../../core/collection/array/randomMultipleFromArray.js";
|
|
5
3
|
import { HashMap } from "../../../core/collection/map/HashMap.js";
|
|
@@ -12,6 +10,7 @@ import { ResourceAccessSpecification } from "../../../core/model/ResourceAccessS
|
|
|
12
10
|
import { number_compare_descending } from "../../../core/primitives/numbers/number_compare_descending.js";
|
|
13
11
|
import { computeStringHash } from "../../../core/primitives/strings/computeStringHash.js";
|
|
14
12
|
import { SequenceBehavior } from "../../intelligence/behavior/composite/SequenceBehavior.js";
|
|
13
|
+
import { OverrideContextBehavior } from "../../intelligence/behavior/decorator/OverrideContextBehavior.js";
|
|
15
14
|
import { BehaviorComponent } from "../../intelligence/behavior/ecs/BehaviorComponent.js";
|
|
16
15
|
import { DieBehavior } from "../../intelligence/behavior/ecs/DieBehavior.js";
|
|
17
16
|
import { Blackboard } from "../../intelligence/blackboard/Blackboard.js";
|
|
@@ -22,6 +21,7 @@ import Entity from "../Entity.js";
|
|
|
22
21
|
import { EntityFlags } from "../EntityFlags.js";
|
|
23
22
|
import { AbstractContextSystem } from "../system/AbstractContextSystem.js";
|
|
24
23
|
import { SystemEntityContext } from "../system/SystemEntityContext.js";
|
|
24
|
+
import { DataScope } from "./DataScope.js";
|
|
25
25
|
import { DynamicActor } from "./DynamicActor.js";
|
|
26
26
|
import { RuleExecution } from "./RuleExecution.js";
|
|
27
27
|
import { computeContextualDynamicRuleDebugString } from "./rules/computeContextualDynamicRuleDebugString.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuleExecution.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/dynamic_actions/RuleExecution.js"],"names":[],"mappings":"AAAA;IAEI;;;OAGG;IACH,6BAAY;IACZ;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"RuleExecution.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/dynamic_actions/RuleExecution.js"],"names":[],"mappings":"AAAA;IAEI;;;OAGG;IACH,6BAAY;IACZ;;;OAGG;IACH,iBAAgB;CAEnB"}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
computeTriangleRayIntersectionBarycentricGeometry
|
|
26
26
|
} from "../../../../core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricGeometry.js";
|
|
27
|
-
import { v3_compute_triangle_normal } from "../../../../core/geom/3d/v3_compute_triangle_normal.js";
|
|
27
|
+
import { v3_compute_triangle_normal } from "../../../../core/geom/3d/triangle/v3_compute_triangle_normal.js";
|
|
28
28
|
import { v3_distance_sqr } from "../../../../core/geom/vec3/v3_distance_sqr.js";
|
|
29
29
|
import Vector4 from "../../../../core/geom/Vector4.js";
|
|
30
30
|
import { makeGeometryIndexed } from "../../geometry/buffered/makeGeometryIndexed.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH;
|
|
1
|
+
{"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"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"}
|
|
@@ -510,9 +510,9 @@ export class Sampler2D {
|
|
|
510
510
|
*
|
|
511
511
|
* @param {number} x
|
|
512
512
|
* @param {number} y
|
|
513
|
-
* @param {number[]|ArrayLike<number>}
|
|
513
|
+
* @param {number[]|ArrayLike<number>} texel
|
|
514
514
|
*/
|
|
515
|
-
write(x, y,
|
|
515
|
+
write(x, y, texel) {
|
|
516
516
|
|
|
517
517
|
const width = this.width;
|
|
518
518
|
|
|
@@ -521,8 +521,10 @@ export class Sampler2D {
|
|
|
521
521
|
const i0 = (y * width + x) * itemSize;
|
|
522
522
|
|
|
523
523
|
for (let i = 0; i < itemSize; i++) {
|
|
524
|
-
this.data[i0 + i] =
|
|
524
|
+
this.data[i0 + i] = texel[i];
|
|
525
525
|
}
|
|
526
|
+
|
|
527
|
+
this.version++;
|
|
526
528
|
}
|
|
527
529
|
|
|
528
530
|
/**
|
|
@@ -736,26 +738,6 @@ export class Sampler2D {
|
|
|
736
738
|
this.version++;
|
|
737
739
|
}
|
|
738
740
|
|
|
739
|
-
/**
|
|
740
|
-
*
|
|
741
|
-
* @param {number} x
|
|
742
|
-
* @param {number} y
|
|
743
|
-
* @param {number[]|Float32Array} value
|
|
744
|
-
*/
|
|
745
|
-
set(x, y, value) {
|
|
746
|
-
const data = this.data;
|
|
747
|
-
const itemSize = this.itemSize;
|
|
748
|
-
|
|
749
|
-
const rowSize = itemSize * this.width;
|
|
750
|
-
|
|
751
|
-
const offset = (rowSize * y) + x * itemSize;
|
|
752
|
-
|
|
753
|
-
for (let i = 0; i < itemSize; i++) {
|
|
754
|
-
data[offset + i] = value[i];
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
this.version++;
|
|
758
|
-
}
|
|
759
741
|
|
|
760
742
|
/**
|
|
761
743
|
* Traverses area inside a circle
|
|
@@ -865,7 +847,7 @@ export class Sampler2D {
|
|
|
865
847
|
// Assume IEEE float 64
|
|
866
848
|
dataSize = 8 * data.length;
|
|
867
849
|
} else {
|
|
868
|
-
dataSize = data.
|
|
850
|
+
dataSize = data.byteLength;
|
|
869
851
|
}
|
|
870
852
|
|
|
871
853
|
return dataSize + 280;
|
|
@@ -907,7 +889,7 @@ export class Sampler2D {
|
|
|
907
889
|
|
|
908
890
|
const texel_count = width * height;
|
|
909
891
|
|
|
910
|
-
const sample_limit = Math.min(2048, texel_count);
|
|
892
|
+
const sample_limit = Math.min(2048 / item_size, texel_count);
|
|
911
893
|
|
|
912
894
|
const step_size = Math.max(1, Math.round(texel_count / sample_limit));
|
|
913
895
|
|
|
@@ -1113,6 +1095,12 @@ export class Sampler2D {
|
|
|
1113
1095
|
|
|
1114
1096
|
}
|
|
1115
1097
|
|
|
1098
|
+
|
|
1099
|
+
/**
|
|
1100
|
+
* @deprecated use {@link write} instead
|
|
1101
|
+
*/
|
|
1102
|
+
Sampler2D.prototype.set = Sampler2D.prototype.write;
|
|
1103
|
+
|
|
1116
1104
|
/**
|
|
1117
1105
|
* @readonly
|
|
1118
1106
|
* @type {boolean}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class OverrideContextBehavior extends AbstractDecoratorBehavior {
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {*} context
|
|
5
|
+
* @param {Behavior} source
|
|
6
|
+
* @return {OverrideContextBehavior}
|
|
7
|
+
*/
|
|
8
|
+
static from(context: any, source: Behavior): OverrideContextBehavior;
|
|
9
|
+
__override_context: {};
|
|
10
|
+
tick(timeDelta: any): import("../BehaviorStatus.js").BehaviorStatus;
|
|
11
|
+
}
|
|
12
|
+
import { AbstractDecoratorBehavior } from "./AbstractDecoratorBehavior.js";
|
|
13
|
+
//# sourceMappingURL=OverrideContextBehavior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OverrideContextBehavior.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/decorator/OverrideContextBehavior.js"],"names":[],"mappings":"AAEA;IAII;;;;;OAKG;IACH,6CAFY,uBAAuB,CASlC;IAfD,uBAAwB;IAiBxB,oEAIC;CASJ;0CAlCyC,gCAAgC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AbstractDecoratorBehavior } from "./AbstractDecoratorBehavior.js";
|
|
2
|
+
|
|
3
|
+
export class OverrideContextBehavior extends AbstractDecoratorBehavior {
|
|
4
|
+
|
|
5
|
+
__override_context = {};
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {*} context
|
|
10
|
+
* @param {Behavior} source
|
|
11
|
+
* @return {OverrideContextBehavior}
|
|
12
|
+
*/
|
|
13
|
+
static from(context, source) {
|
|
14
|
+
const r = new OverrideContextBehavior();
|
|
15
|
+
|
|
16
|
+
r.__override_context = context;
|
|
17
|
+
r.setSource(source);
|
|
18
|
+
|
|
19
|
+
return r;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
tick(timeDelta) {
|
|
23
|
+
const s = this.__source.tick(timeDelta);
|
|
24
|
+
|
|
25
|
+
return s;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
initialize(context) {
|
|
29
|
+
super.initialize(context);
|
|
30
|
+
|
|
31
|
+
const child_context = Object.assign({}, context, this.__override_context);
|
|
32
|
+
|
|
33
|
+
this.__source.initialize(child_context);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticKnowledgeDatabase.d.ts","sourceRoot":"","sources":["../../../../../src/engine/knowledge/database/StaticKnowledgeDatabase.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StaticKnowledgeDatabase.d.ts","sourceRoot":"","sources":["../../../../../src/engine/knowledge/database/StaticKnowledgeDatabase.js"],"names":[],"mappings":"mCAWU,MAAM;;;;;;;AAShB;IAEI;;;OAGG;IACH,SAFU,aAAa,oBAAoB,CAAC,CAEmC;IAG/E;;;;OAIG;IACH,gBAAa;IAQb;;;OAGG;IACH,qCAEC;IAGD;;OAEG;IACH,cAUC;IAED;;;;;OAKG;IACH,QAJW,MAAM,QACN,MAAM,yCAiChB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,0CAAmC,SAAS,CAkBxD;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,gCAA4B,SAAS,CAUjD;IAGD;;;OAGG;IACH,wBAcC;IAED;;;;OAIG;IACH,qDAiBC;IAGD;;;;;;OAMG;IACH,qBAQC;IAED;;;;;OAKG;IACH,mEAmBC;IAED;;;;;;;OAOG;IACH,qBAeC;IAED;;;;;;OAMG;IACH,mBAIC;IAED;;;;;OAKG;IACH,mEAmCC;IAGL,mCAA2D;;CAF1D;yBArTwB,qCAAqC;mDAIX,yCAAyC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
1
2
|
import { IllegalStateException } from "../../../core/fsm/exceptions/IllegalStateException.js";
|
|
2
3
|
import { objectKeyByValue } from "../../../core/model/object/objectKeyByValue.js";
|
|
3
4
|
import ObservedEnum from "../../../core/model/ObservedEnum.js";
|
|
@@ -70,6 +71,9 @@ export class StaticKnowledgeDatabase {
|
|
|
70
71
|
* @param {StaticKnowledgeDataTable} table
|
|
71
72
|
*/
|
|
72
73
|
add(id, path, table) {
|
|
74
|
+
assert.defined(table,'table');
|
|
75
|
+
assert.notNull(table,'table');
|
|
76
|
+
|
|
73
77
|
const state = this.__state.getValue();
|
|
74
78
|
|
|
75
79
|
if (state !== StaticKnowledgeState.Initial) {
|