@woosh/meep-engine 2.84.3 → 2.84.5
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 +163 -109
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +163 -109
- package/editor/view/ecs/EntityEditor.js +7 -8
- package/package.json +1 -1
- package/src/core/math/random/roundFair.js +5 -2
- package/src/core/math/random/roundFair.spec.js +12 -0
- package/src/core/math/random/seededRandom_Mulberry32.spec.js +19 -0
- package/src/core/model/node-graph/node/NodeInstancePortReference.spec.js +25 -2
- package/src/core/model/node-graph/node/Port.js +8 -6
- package/src/core/model/node-graph/node/Port.spec.js +49 -0
- package/src/core/process/matcher/and.js +16 -0
- package/src/core/process/matcher/isDefined.js +8 -0
- package/src/core/process/matcher/isEqualTo.js +10 -0
- package/src/core/process/matcher/isGreaterThan.js +10 -0
- package/src/core/process/matcher/isGreaterThanOrEqualTo.js +10 -0
- package/src/core/process/matcher/isInstanceOf.js +10 -0
- package/src/core/process/matcher/isLessThan.js +10 -0
- package/src/core/process/matcher/isLessThanOrEqualTo.js +10 -0
- package/src/core/process/matcher/isNull.js +8 -0
- package/src/core/process/matcher/isTypeOf.js +16 -0
- package/src/core/process/matcher/not.js +10 -0
- package/src/core/process/matcher/or.js +16 -0
- package/src/core/process/task/util/actionTask.spec.js +14 -0
- package/src/core/process/task/util/countTask.js +1 -1
- package/src/core/process/task/util/countTask.spec.js +18 -0
- package/src/engine/asset/AssetDescription.js +6 -0
- package/src/engine/ecs/Entity.js +9 -4
- package/src/engine/ecs/EntityComponentDataset.js +78 -26
- package/src/view/common/LabelView.js +3 -1
- package/src/view/elements/windrose/WindRoseDiagram.js +3 -3
- package/src/core/math/spline/spline_catmullrom_1d.js +0 -120
- package/src/core/process/IntervalExecutor.js +0 -78
- package/src/core/process/matcher/Matchers.js +0 -145
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Alex Goldring
|
|
3
|
-
* @copyright Alex Goldring 2017
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { assert } from "../../assert.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param {*} value
|
|
11
|
-
* @returns {boolean}
|
|
12
|
-
*/
|
|
13
|
-
export function isNull(value) {
|
|
14
|
-
return value === null;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param {*} value
|
|
20
|
-
* @return {boolean}
|
|
21
|
-
*/
|
|
22
|
-
export function isDefined(value) {
|
|
23
|
-
return value !== undefined;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* performs instanceof match
|
|
28
|
-
* @param {function} type
|
|
29
|
-
* @returns {function(*): boolean}
|
|
30
|
-
*/
|
|
31
|
-
export function isInstanceOf(type) {
|
|
32
|
-
return function (m) {
|
|
33
|
-
return m instanceof type;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* performs typeof match
|
|
39
|
-
* @param {string} type
|
|
40
|
-
* @returns {function(*): boolean}
|
|
41
|
-
*/
|
|
42
|
-
export function isTypeOf(type) {
|
|
43
|
-
assert.notEqual(['number', 'boolean', 'string', 'function', 'object', 'undefined'].indexOf(type), -1, `type must be one of [number, boolean, string, function, object, undefined], instead was '${type}'`);
|
|
44
|
-
|
|
45
|
-
return function (m) {
|
|
46
|
-
return typeof m === type;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* @param {number} value
|
|
53
|
-
* @returns {function(*): boolean}
|
|
54
|
-
*/
|
|
55
|
-
export function isGreaterThan(value) {
|
|
56
|
-
return function (x) {
|
|
57
|
-
return x > value;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @param {number} value
|
|
64
|
-
* @returns {function(*): boolean}
|
|
65
|
-
*/
|
|
66
|
-
export function isGreaterThanOrEqualTo(value) {
|
|
67
|
-
return function (x) {
|
|
68
|
-
return x >= value;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
*
|
|
74
|
-
* @param {number} value
|
|
75
|
-
* @returns {function(*): boolean}
|
|
76
|
-
*/
|
|
77
|
-
export function isLessThan(value) {
|
|
78
|
-
return function (x) {
|
|
79
|
-
return x < value;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
*
|
|
85
|
-
* @param {number} value
|
|
86
|
-
* @returns {function(*): boolean}
|
|
87
|
-
*/
|
|
88
|
-
export function isLessThanOrEqualTo(value) {
|
|
89
|
-
return function (x) {
|
|
90
|
-
return x <= value;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
* @param {number} value
|
|
97
|
-
* @returns {function(*): boolean}
|
|
98
|
-
*/
|
|
99
|
-
export function isEqualTo(value) {
|
|
100
|
-
return function (x) {
|
|
101
|
-
return x === value;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
*
|
|
108
|
-
* @param {function} m
|
|
109
|
-
* @returns {function(*): boolean}
|
|
110
|
-
*/
|
|
111
|
-
export function not(m) {
|
|
112
|
-
return function (v) {
|
|
113
|
-
return !m(v);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Joins two matchers via AND
|
|
119
|
-
* @param {function(*):boolean} a
|
|
120
|
-
* @param {function(*):boolean} b
|
|
121
|
-
* @returns {function(*):boolean}
|
|
122
|
-
*/
|
|
123
|
-
export function and(a, b) {
|
|
124
|
-
assert.typeOf(a, 'function', 'a');
|
|
125
|
-
assert.typeOf(b, 'function', 'b');
|
|
126
|
-
|
|
127
|
-
return function (m) {
|
|
128
|
-
return a(m) && b(m);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Joins two matchers via OR
|
|
134
|
-
* @param {function(*):boolean} a
|
|
135
|
-
* @param {function(*):boolean} b
|
|
136
|
-
* @returns {function(*):boolean}
|
|
137
|
-
*/
|
|
138
|
-
export function or(a, b) {
|
|
139
|
-
assert.typeOf(a, 'function', 'a');
|
|
140
|
-
assert.typeOf(b, 'function', 'b');
|
|
141
|
-
|
|
142
|
-
return function (m) {
|
|
143
|
-
return a(m) || b(m);
|
|
144
|
-
}
|
|
145
|
-
}
|