@woosh/meep-engine 2.118.7 → 2.118.9
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/meep.cjs +11 -145
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +11 -145
- package/package.json +1 -1
- package/samples/generation/SampleGenerator0.js +55 -55
- package/samples/generation/generators/interactive/mir_generator_place_buff_objects.js +21 -23
- package/samples/generation/generators/mir_generator_place_bases.js +20 -20
- package/samples/generation/generators/mir_generator_place_road_decorators.js +11 -11
- package/src/core/color/Color.js +1 -1
- package/src/core/color/operations/color_darken.d.ts +8 -0
- package/src/core/color/operations/color_darken.d.ts.map +1 -0
- package/src/core/color/operations/color_darken.js +27 -0
- package/src/core/color/operations/color_desaturate.d.ts +3 -2
- package/src/core/color/operations/color_desaturate.d.ts.map +1 -1
- package/src/core/color/operations/color_desaturate.js +16 -5
- package/src/core/color/operations/color_lighten.d.ts +8 -0
- package/src/core/color/operations/color_lighten.d.ts.map +1 -0
- package/src/core/color/operations/color_lighten.js +27 -0
- package/src/core/color/operations/color_saturate.d.ts +8 -0
- package/src/core/color/operations/color_saturate.d.ts.map +1 -0
- package/src/core/color/operations/color_saturate.js +27 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts +9 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts.map +1 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.js +29 -0
- package/src/core/math/gaussian.d.ts.map +1 -1
- package/src/core/math/gaussian.js +4 -1
- package/src/core/math/physics/pdf/pdf_GGX.d.ts +3 -3
- package/src/core/math/physics/pdf/pdf_GGX.d.ts.map +1 -1
- package/src/core/math/physics/pdf/pdf_GGX.js +7 -6
- package/src/core/model/ObservedBoolean.js +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.d.ts +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.js +7 -7
- package/src/core/model/object/validatedObjectValueByKey.js +1 -1
- package/src/core/model/reactive/transform/{ReactiveTypeInferrence.d.ts → inferReactiveExpressionTypes.d.ts} +1 -1
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.d.ts.map +1 -0
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.js +60 -0
- package/src/core/model/reactive/trigger/ReactiveTrigger.js +1 -1
- package/src/core/process/delay.d.ts.map +1 -1
- package/src/core/process/delay.js +6 -0
- package/src/core/process/task/TaskGroup.d.ts.map +1 -1
- package/src/core/process/task/TaskGroup.js +3 -8
- package/src/core/process/undo/ActionGroup.d.ts.map +1 -1
- package/src/core/process/undo/ActionGroup.js +6 -9
- package/src/core/process/worker/extractTransferables.d.ts +3 -2
- package/src/core/process/worker/extractTransferables.d.ts.map +1 -1
- package/src/core/process/worker/extractTransferables.js +32 -12
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +3 -1
- package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics/GraphicsEngine.js +4 -0
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.js +4 -0
- package/src/generation/grid/actions/ContinuousGridCellAction.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellAction.js +6 -8
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js +20 -22
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +23 -28
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.js +7 -10
- package/src/generation/grid/generation/GridTaskSequence.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskSequence.js +2 -5
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.d.ts → GridTaskActionRuleSet.d.ts} +1 -1
- package/src/generation/grid/generation/discrete/GridTaskActionRuleSet.d.ts.map +1 -0
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.js → GridTaskActionRuleSet.js} +13 -16
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +51 -53
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +20 -23
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.js +38 -39
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.js +8 -11
- package/src/generation/grid/generation/road/PathEndPoint.d.ts.map +1 -1
- package/src/generation/grid/generation/road/PathEndPoint.js +8 -10
- package/src/generation/grid/generation/road/RoadConnection.d.ts.map +1 -1
- package/src/generation/grid/generation/road/RoadConnection.js +4 -5
- package/src/generation/markers/GridCellActionPlaceMarker.d.ts.map +1 -1
- package/src/generation/markers/GridCellActionPlaceMarker.js +7 -5
- package/src/view/common/LabelView.d.ts.map +1 -1
- package/src/view/common/LabelView.js +0 -3
- package/src/core/model/LinearValue.d.ts +0 -88
- package/src/core/model/LinearValue.d.ts.map +0 -1
- package/src/core/model/LinearValue.js +0 -140
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.d.ts.map +0 -1
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.js +0 -54
- package/src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.d.ts.map +0 -1
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
2
|
|
|
3
3
|
export class RoadConnection {
|
|
4
|
-
constructor() {
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
*
|
|
8
7
|
* @type {PathEndPoint}
|
|
9
8
|
*/
|
|
10
|
-
|
|
9
|
+
source = null;
|
|
10
|
+
|
|
11
11
|
/**
|
|
12
12
|
*
|
|
13
13
|
* @type {PathEndPoint}
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
target = null;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
*
|
|
19
19
|
* @type {number[]}
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
indices = [];
|
|
22
22
|
|
|
23
|
-
}
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridCellActionPlaceMarker.d.ts","sourceRoot":"","sources":["../../../../src/generation/markers/GridCellActionPlaceMarker.js"],"names":[],"mappings":"AAOA;IAkFI;;;;;;;;;;OAUG;IACH,0FAFY,yBAAyB,
|
|
1
|
+
{"version":3,"file":"GridCellActionPlaceMarker.d.ts","sourceRoot":"","sources":["../../../../src/generation/markers/GridCellActionPlaceMarker.js"],"names":[],"mappings":"AAOA;IAkFI;;;;;;;;;;OAUG;IACH,0FAFY,yBAAyB,CAwCpC;IAjID;;;OAGG;IACH,aAAY;IAEZ;;;OAGG;IACH,WAFU,SAAS,CAES;IAE5B;;;OAGG;IACH,MAFU,QAAQ,CAER;IAEV,eAAgB;IAEhB,aAAS;IAET;;;OAGG;IACH,cAFU,uBAAuB,CAEf;IAElB;;;OAGG;IACH,UAFU,MAAM,CAEH;IAEb;;;OAGG;IACH,QAFU,OAAO,CAEM;IAEvB,uCAWC;IAED;;;;OAIG;IACH,qBAFa,OAAO,CAYnB;IAED;;;OAGG;IACH,yDAIC;IAqDD;;;;;;;OAOG;IACH,6BALW,MAAM,KACN,MAAM,YACN,MAAM,GACJ,UAAU,CAgEtB;IAED,wDAIC;IAGL;;;OAGG;IACH,sCAFU,OAAO,CAE8C;CAN9D;+BArN8B,uCAAuC;0BAD5C,yCAAyC;oBAF/C,4BAA4B;2BAIrB,iBAAiB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { GridCellAction } from "../placement/action/GridCellAction.js";
|
|
2
|
-
import { MarkerNode } from "./MarkerNode.js";
|
|
3
|
-
import { Transform } from "../../engine/ecs/transform/Transform.js";
|
|
4
|
-
import Vector2 from "../../core/geom/Vector2.js";
|
|
5
1
|
import { assert } from "../../core/assert.js";
|
|
2
|
+
import Vector2 from "../../core/geom/Vector2.js";
|
|
6
3
|
import Vector3 from "../../core/geom/Vector3.js";
|
|
4
|
+
import { Transform } from "../../engine/ecs/transform/Transform.js";
|
|
5
|
+
import { GridCellAction } from "../placement/action/GridCellAction.js";
|
|
6
|
+
import { MarkerNode } from "./MarkerNode.js";
|
|
7
7
|
|
|
8
8
|
export class GridCellActionPlaceMarker extends GridCellAction {
|
|
9
9
|
|
|
@@ -108,7 +108,9 @@ export class GridCellActionPlaceMarker extends GridCellAction {
|
|
|
108
108
|
priority = 0
|
|
109
109
|
}) {
|
|
110
110
|
|
|
111
|
-
assert.
|
|
111
|
+
assert.isString(type, 'type');
|
|
112
|
+
assert.isNumber(size, 'size');
|
|
113
|
+
assert.greaterThanOrEqual(size, 0, 'size must be non-negative');
|
|
112
114
|
|
|
113
115
|
const r = new GridCellActionPlaceMarker();
|
|
114
116
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelView.d.ts","sourceRoot":"","sources":["../../../../src/view/common/LabelView.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"LabelView.d.ts","sourceRoot":"","sources":["../../../../src/view/common/LabelView.js"],"names":[],"mappings":";AA2IA;IACI;;;;;;;OA+CC;IArCG,WAAkB;IASlB,gCAA4B;IAC5B,mDAA4B;IAC5B,gCAA4B;IA4BhC;;;;OAIG;IACH,mBAEC;IAGD;;;OAGG;IACH,cAFW,MAAM,QAIhB;IAED,wBAYC;CAOJ;iBAlNgB,YAAY;qBAdR,6BAA6B;4BACtB,oCAAoC"}
|
|
@@ -4,7 +4,6 @@ import { noop } from "../../core/function/noop.js";
|
|
|
4
4
|
import { passThrough } from "../../core/function/passThrough.js";
|
|
5
5
|
import Vector1 from "../../core/geom/Vector1.js";
|
|
6
6
|
import BoundedValue from "../../core/model/BoundedValue.js";
|
|
7
|
-
import LinearValue from "../../core/model/LinearValue.js";
|
|
8
7
|
import ObservedBoolean from "../../core/model/ObservedBoolean.js";
|
|
9
8
|
import ObservedInteger from "../../core/model/ObservedInteger.js";
|
|
10
9
|
import ObservedString from "../../core/model/ObservedString.js";
|
|
@@ -80,7 +79,6 @@ function findProcessor(model) {
|
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
|
|
83
|
-
|
|
84
82
|
class ValueProcessor {
|
|
85
83
|
/**
|
|
86
84
|
* @template Container, Value
|
|
@@ -127,7 +125,6 @@ const processors = [
|
|
|
127
125
|
p(isInstanceOf(ObservedBoolean), extractorGetValue, format),
|
|
128
126
|
p(isInstanceOf(ObservedValue), extractorGetValue, format),
|
|
129
127
|
p(isInstanceOf(ObservedString), extractorGetValue, format),
|
|
130
|
-
p(isInstanceOf(LinearValue), extractorGetValue, formatNumber),
|
|
131
128
|
p(isInstanceOf(BoundedValue), extractBoundedValue, formatArray),
|
|
132
129
|
p(isInstanceOf(Stat), extractorGetValue, formatNumber),
|
|
133
130
|
p(isInstanceOf(Vector1), extractorGetValue, formatNumber),
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
export default LinearValue;
|
|
2
|
-
declare class LinearValue {
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {number} [x = 0]
|
|
6
|
-
* @param {number} [a = 0]
|
|
7
|
-
* @param {number} [b = 1]
|
|
8
|
-
* @constructor
|
|
9
|
-
*/
|
|
10
|
-
constructor(x?: number, a?: number, b?: number);
|
|
11
|
-
/**
|
|
12
|
-
* @readonly
|
|
13
|
-
* @type {Signal}
|
|
14
|
-
*/
|
|
15
|
-
readonly onChanged: Signal;
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @type {number}
|
|
19
|
-
*/
|
|
20
|
-
x: number;
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @type {number}
|
|
24
|
-
*/
|
|
25
|
-
a: number;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @type {number}
|
|
29
|
-
*/
|
|
30
|
-
b: number;
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @param {LinearValue} other
|
|
34
|
-
* @returns {LinearValue}
|
|
35
|
-
*/
|
|
36
|
-
copy(other: LinearValue): LinearValue;
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @param {number} x
|
|
40
|
-
* @param {number} a
|
|
41
|
-
* @param {number} b
|
|
42
|
-
* @returns {LinearValue}
|
|
43
|
-
*/
|
|
44
|
-
set(x: number, a: number, b: number): LinearValue;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @param v
|
|
48
|
-
* @returns {LinearValue}
|
|
49
|
-
*/
|
|
50
|
-
addMultiplier(v: any): LinearValue;
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @param v
|
|
54
|
-
* @returns {LinearValue}
|
|
55
|
-
*/
|
|
56
|
-
subMultiplier(v: any): LinearValue;
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
* @param v
|
|
60
|
-
* @returns {LinearValue}
|
|
61
|
-
*/
|
|
62
|
-
addConstant(v: any): LinearValue;
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
* @param v
|
|
66
|
-
* @returns {LinearValue}
|
|
67
|
-
*/
|
|
68
|
-
subConstant(v: any): LinearValue;
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
* @returns {number}
|
|
72
|
-
*/
|
|
73
|
-
getValue(): number;
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* @param {LinearValue} other
|
|
77
|
-
* @returns {boolean}
|
|
78
|
-
*/
|
|
79
|
-
equals(other: LinearValue): boolean;
|
|
80
|
-
toJSON(): {
|
|
81
|
-
x: number;
|
|
82
|
-
a: number;
|
|
83
|
-
b: number;
|
|
84
|
-
};
|
|
85
|
-
fromJSON(json: any): void;
|
|
86
|
-
}
|
|
87
|
-
import Signal from "../events/signal/Signal.js";
|
|
88
|
-
//# sourceMappingURL=LinearValue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinearValue.d.ts","sourceRoot":"","sources":["../../../../src/core/model/LinearValue.js"],"names":[],"mappings":";AAGA;IAQI;;;;;;OAMG;IACH,gBALW,MAAM,MACN,MAAM,MACN,MAAM,EAwBhB;IAlCD;;;OAGG;IACH,oBAFU,MAAM,CAES;IAcrB;;;OAGG;IACH,GAFU,MAAM,CAEN;IACV;;;OAGG;IACH,GAFU,MAAM,CAEN;IACV;;;OAGG;IACH,GAFU,MAAM,CAEN;IAId;;;;OAIG;IACH,YAHW,WAAW,GACT,WAAW,CAIvB;IAED;;;;;;OAMG;IACH,OALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,WAAW,CASvB;IAED;;;;OAIG;IACH,uBAFa,WAAW,CAOvB;IAED;;;;OAIG;IACH,uBAFa,WAAW,CAIvB;IAED;;;;OAIG;IACH,qBAFa,WAAW,CAOvB;IAED;;;;OAIG;IACH,qBAFa,WAAW,CAIvB;IAED;;;OAGG;IACH,YAFa,MAAM,CAKlB;IAED;;;;OAIG;IACH,cAHW,WAAW,GACT,OAAO,CAInB;IAED;;;;MAMC;IAED,0BAEC;CACJ;mBAxIkB,4BAA4B"}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { assert } from "../assert.js";
|
|
2
|
-
import Signal from "../events/signal/Signal.js";
|
|
3
|
-
|
|
4
|
-
class LinearValue {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @readonly
|
|
8
|
-
* @type {Signal}
|
|
9
|
-
*/
|
|
10
|
-
onChanged = new Signal();
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param {number} [x = 0]
|
|
15
|
-
* @param {number} [a = 0]
|
|
16
|
-
* @param {number} [b = 1]
|
|
17
|
-
* @constructor
|
|
18
|
-
*/
|
|
19
|
-
constructor(x = 0, a = 0, b = 1) {
|
|
20
|
-
assert.isNumber(x, 'x');
|
|
21
|
-
assert.isNumber(a, 'a');
|
|
22
|
-
assert.isNumber(b, 'b');
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @type {number}
|
|
27
|
-
*/
|
|
28
|
-
this.x = x;
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @type {number}
|
|
32
|
-
*/
|
|
33
|
-
this.a = a;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @type {number}
|
|
37
|
-
*/
|
|
38
|
-
this.b = b;
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @param {LinearValue} other
|
|
45
|
-
* @returns {LinearValue}
|
|
46
|
-
*/
|
|
47
|
-
copy(other) {
|
|
48
|
-
return this.set(other.x, other.a, other.b);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @param {number} x
|
|
54
|
-
* @param {number} a
|
|
55
|
-
* @param {number} b
|
|
56
|
-
* @returns {LinearValue}
|
|
57
|
-
*/
|
|
58
|
-
set(x, a, b) {
|
|
59
|
-
this.x = x;
|
|
60
|
-
this.a = a;
|
|
61
|
-
this.b = b;
|
|
62
|
-
|
|
63
|
-
this.onChanged.dispatch(x, a, b);
|
|
64
|
-
return this;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
* @param v
|
|
70
|
-
* @returns {LinearValue}
|
|
71
|
-
*/
|
|
72
|
-
addMultiplier(v) {
|
|
73
|
-
this.b += v;
|
|
74
|
-
|
|
75
|
-
this.onChanged.dispatch(this.x, this.a, this.b);
|
|
76
|
-
return this;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
* @param v
|
|
82
|
-
* @returns {LinearValue}
|
|
83
|
-
*/
|
|
84
|
-
subMultiplier(v) {
|
|
85
|
-
return this.addMultiplier(-v);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
* @param v
|
|
91
|
-
* @returns {LinearValue}
|
|
92
|
-
*/
|
|
93
|
-
addConstant(v) {
|
|
94
|
-
this.a += v;
|
|
95
|
-
|
|
96
|
-
this.onChanged.dispatch(this.x, this.a, this.b);
|
|
97
|
-
return this;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
*
|
|
102
|
-
* @param v
|
|
103
|
-
* @returns {LinearValue}
|
|
104
|
-
*/
|
|
105
|
-
subConstant(v) {
|
|
106
|
-
return this.addConstant(-v);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
*
|
|
111
|
-
* @returns {number}
|
|
112
|
-
*/
|
|
113
|
-
getValue() {
|
|
114
|
-
// y = b*x + a
|
|
115
|
-
return this.x * this.b + this.a;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
*
|
|
120
|
-
* @param {LinearValue} other
|
|
121
|
-
* @returns {boolean}
|
|
122
|
-
*/
|
|
123
|
-
equals(other) {
|
|
124
|
-
return this.x === other.x && this.a === other.a && this.b === other.b;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
toJSON() {
|
|
128
|
-
return {
|
|
129
|
-
x: this.x,
|
|
130
|
-
a: this.a,
|
|
131
|
-
b: this.b
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
fromJSON(json) {
|
|
136
|
-
this.set(json.x, json.a, json.b);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export default LinearValue;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReactiveTypeInferrence.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/transform/ReactiveTypeInferrence.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,4EAiCC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import DataType from "../../../parser/simple/DataType.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {ReactiveExpression} node
|
|
6
|
-
* @param {DataType} type
|
|
7
|
-
*/
|
|
8
|
-
function setNodeType(node, type) {
|
|
9
|
-
if (node.dataType === DataType.Any) {
|
|
10
|
-
node.dataType = type;
|
|
11
|
-
} else if (node.dataType !== type) {
|
|
12
|
-
//wrong type
|
|
13
|
-
console.warn(`Expected member or logic expression to have type '${type}', instead was '${node.dataType}'`, node);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Infer types in an expression tree, input tree is mutated as a result
|
|
19
|
-
* @param {ReactiveExpression} exp
|
|
20
|
-
*/
|
|
21
|
-
export function inferReactiveExpressionTypes(exp) {
|
|
22
|
-
exp.traverse(function (v) {
|
|
23
|
-
if (v.isBinaryExpression) {
|
|
24
|
-
if (v.left !== null && v.right !== null) {
|
|
25
|
-
if (v.isLogicExpression) {
|
|
26
|
-
setNodeType(v.left, DataType.Boolean);
|
|
27
|
-
setNodeType(v.right, DataType.Boolean);
|
|
28
|
-
} else if (v.isComparativeExpression) {
|
|
29
|
-
if (v.isReactiveEquals || v.isReactiveNotEquals) {
|
|
30
|
-
if (v.left.dataType !== DataType.Any) {
|
|
31
|
-
setNodeType(v.right, v.left.dataType);
|
|
32
|
-
} else if (v.right.dataType !== DataType.Any) {
|
|
33
|
-
setNodeType(v.left, v.right.dataType);
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
setNodeType(v.left, DataType.Number);
|
|
37
|
-
setNodeType(v.right, DataType.Number);
|
|
38
|
-
}
|
|
39
|
-
} else if (v.isArithmeticExpression) {
|
|
40
|
-
setNodeType(v.left, DataType.Number);
|
|
41
|
-
setNodeType(v.right, DataType.Number);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
} else if (v.isUnaryExpression) {
|
|
45
|
-
if (v.source !== null) {
|
|
46
|
-
if (v.isLogicExpression) {
|
|
47
|
-
setNodeType(v.source, DataType.Boolean);
|
|
48
|
-
} else if (v.isArithmeticExpression) {
|
|
49
|
-
setNodeType(v.source, DataType.Number);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskCellActionRuleSet.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.js"],"names":[],"mappings":"AAGA;IAiBI;;;;;;OAMG;IACH;;;;QAFa,qBAAqB,CAejC;IAjCG;;;OAGG;IACH,yBAAiB;IAEjB;;;OAGG;IACH,YAFU,MAAM,CAEG;IAyBvB,2CAEC;CACJ;kCA7CiC,4BAA4B"}
|