@woosh/meep-engine 2.119.15 → 2.119.17
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/README.md +8 -12
- package/package.json +1 -1
- package/src/core/model/reactive/model/ReactiveBinaryExpression.d.ts.map +1 -1
- package/src/core/model/reactive/model/ReactiveBinaryExpression.js +17 -21
- package/src/core/model/reactive/model/ReactiveUnaryExpression.d.ts +1 -1
- package/src/core/model/reactive/model/ReactiveUnaryExpression.d.ts.map +1 -1
- package/src/core/model/reactive/model/ReactiveUnaryExpression.js +10 -10
- package/src/core/model/reactive/model/arithmetic/ReactiveNegate.d.ts.map +1 -1
- package/src/core/model/reactive/model/logic/ReactiveNot.d.ts.map +1 -1
- package/src/engine/achievements/AchievementGateway.d.ts.map +1 -1
- package/src/engine/achievements/AchievementGateway.js +1 -1
- package/src/engine/achievements/AchievementManager.d.ts.map +1 -1
- package/src/engine/achievements/AchievementManager.js +5 -2
- package/src/engine/achievements/gateway/StorageAchievementGateway.d.ts.map +1 -1
- package/src/engine/achievements/gateway/StorageAchievementGateway.js +14 -9
- package/src/engine/intelligence/behavior/ecs/BehaviorComponent.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorComponent.js +22 -54
package/README.md
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
# Meep Engine
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Getting Started
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
We offer a [minimal project](http://gitlab.company-named.com/travnik/dream-engine-template) with no bells or whistles, just enough to run the engine and get you starter. If you're starting from scratch this is likely the best option.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Documentation
|
|
8
|
+
|
|
9
|
+
[Engine Documentation](http://meep-engine.company-named.com:8080/docs/getting_started/Installation)
|
|
10
|
+
|
|
11
|
+
## Samples
|
|
12
|
+
To help get you started, various samples are provided under `/samples` folder. Feel free to use them as a point of reference.
|
|
8
13
|
|
|
9
14
|
## Quality
|
|
10
15
|
|
|
11
16
|
Meep is covered by 1,959 unit tests
|
|
12
17
|
|
|
13
|
-

|
|
14
|
-
|
|
15
18
|
The aim is not to have 100% coverage, [but to ensure quality](https://about.codecov.io/blog/the-case-against-100-code-coverage/). As a result, the tests are written to cover complex code first and to exhaustively validate critical algorithms.
|
|
16
19
|
Most of the test code is significantly larger than the code that they are testing.
|
|
17
20
|
|
|
18
|
-
## Samples
|
|
19
|
-
To help get you started, various samples are provided under `/samples` folder. Feel free to use them as a point of reference.
|
|
20
|
-
|
|
21
|
-
## Documentation
|
|
22
|
-
|
|
23
|
-
[Engine Documentation](http://meep-engine.company-named.com:8080/docs/getting_started/Installation)
|
|
24
|
-
|
|
25
21
|
## Features
|
|
26
22
|
|
|
27
23
|
### Automatic instancing
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactiveBinaryExpression.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/model/ReactiveBinaryExpression.js"],"names":[],"mappings":"AAIA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"ReactiveBinaryExpression.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/model/ReactiveBinaryExpression.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;;IAEI;;;OAGG;IACH,MAFU,0BAAmB,IAAI,CAErB;IACZ;;;OAGG;IACH,OAFU,0BAAmB,IAAI,CAEpB;IAEb;;;;OAIG;IACH,mBAAuB;IAEvB,uBAQC;IAED,wBAcC;IAED,eAMC;IAED,0BAQC;IAED,eAUC;IAED;;;OAGG;IACH,kCAFa,IAAE,OAAO,GAAC,MAAM,CAI5B;IAED,2CAKC;IAED;;;;OAIG;IACH,qCAkBC;IAED,mBAaC;IAyBL;;;;;;OAMG;IACH,wBAFU,OAAO,CAE+B;IAEhD;;;OAGG;IACH,6BAFU,OAAO,CAEoC;CAfpD;mCA7JkC,yBAAyB"}
|
|
@@ -6,28 +6,24 @@ import { ReactiveExpression } from "./ReactiveExpression.js";
|
|
|
6
6
|
* @extends {ReactiveExpression}
|
|
7
7
|
*/
|
|
8
8
|
export class ReactiveBinaryExpression extends ReactiveExpression {
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @type {ReactiveExpression|null}
|
|
15
|
-
*/
|
|
16
|
-
this.left = null;
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @type {ReactiveExpression|null}
|
|
20
|
-
*/
|
|
21
|
-
this.right = null;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @type {undefined}
|
|
26
|
-
* @private
|
|
27
|
-
*/
|
|
28
|
-
this.__oldValue = undefined;
|
|
29
9
|
|
|
30
|
-
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @type {ReactiveExpression|null}
|
|
13
|
+
*/
|
|
14
|
+
left = null;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @type {ReactiveExpression|null}
|
|
18
|
+
*/
|
|
19
|
+
right = null;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @type {undefined}
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
__oldValue = undefined;
|
|
31
27
|
|
|
32
28
|
copy(other) {
|
|
33
29
|
assert.equal(other.isReactiveExpression, true, 'other.isReactiveExpression !== true');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactiveUnaryExpression.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/model/ReactiveUnaryExpression.js"],"names":[],"mappings":"AAIA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"ReactiveUnaryExpression.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/model/ReactiveUnaryExpression.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;;IAEI;;;OAGG;IACH,QAFU,mBAAmB,CAAC,CAAC,CAEjB;IAEd,uBAMC;IAED,qBAIC;IAED,2CAIC;IAED,2BAMC;IAED,mBAQC;IAED;;OAEG;IACH,kCAEC;IAED,2BAIC;IAED;;;;OAIG;IACH,wCAFa,OAAO,CAOnB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED,iBAEC;IAGL;;;OAGG;IACH,4BAFU,OAAO,CAEkC;CANlD;mCAvFkC,yBAAyB"}
|
|
@@ -6,16 +6,12 @@ import { ReactiveExpression } from "./ReactiveExpression.js";
|
|
|
6
6
|
* @template T,R
|
|
7
7
|
*/
|
|
8
8
|
export class ReactiveUnaryExpression extends ReactiveExpression {
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @type {ReactiveExpression<T>}
|
|
13
|
+
*/
|
|
14
|
+
source = null;
|
|
19
15
|
|
|
20
16
|
copy(other) {
|
|
21
17
|
this.disconnect();
|
|
@@ -46,6 +42,10 @@ export class ReactiveUnaryExpression extends ReactiveExpression {
|
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
disconnect() {
|
|
45
|
+
if (this.source === null) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
49
|
this.source.onChanged.remove(this.update, this);
|
|
50
50
|
|
|
51
51
|
this.source = null;
|
|
@@ -61,7 +61,7 @@ export class ReactiveUnaryExpression extends ReactiveExpression {
|
|
|
61
61
|
evaluate(scope) {
|
|
62
62
|
const source_value = this.source.evaluate(scope);
|
|
63
63
|
|
|
64
|
-
return transform(source_value);
|
|
64
|
+
return this.transform(source_value);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactiveNegate.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/model/reactive/model/arithmetic/ReactiveNegate.js"],"names":[],"mappings":"AAGA;IA+BI;;;;OAIG;IACH,yCAFa,cAAc,CAQ1B
|
|
1
|
+
{"version":3,"file":"ReactiveNegate.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/model/reactive/model/arithmetic/ReactiveNegate.js"],"names":[],"mappings":"AAGA;IA+BI;;;;OAIG;IACH,yCAFa,cAAc,CAQ1B;;IAzCD;;;;OAIG;IACH,aAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,SAFY,cAAc,CAQzB;IAED,4BAEC;IAED,iBAEC;IAiBL;;;OAGG;IACH,mBAFU,WAAS,MAAM,CAEQ;IAEjC;;;OAGG;IACH,iCAFU,OAAO,CAE8B;IAE/C;;;OAGG;IACH,2BAFU,OAAO,CAEwB;CAlBxC;wCA7CuC,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactiveNot.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/model/reactive/model/logic/ReactiveNot.js"],"names":[],"mappings":"AAGA;IA8BI;;;;OAIG;IACH,yCAFa,WAAW,CAQvB
|
|
1
|
+
{"version":3,"file":"ReactiveNot.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/model/reactive/model/logic/ReactiveNot.js"],"names":[],"mappings":"AAGA;IA8BI;;;;OAIG;IACH,yCAFa,WAAW,CAQvB;;IAxCD;;;;OAIG;IACH,aAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,SAFY,WAAW,CAQtB;IAED,4BAEC;IAED,iBAEC;IAgBL;;;OAGG;IACH,4BAA8B;IAE9B;;;OAGG;IACH,4BAFU,OAAO,CAEsB;IAEvC;;;OAGG;IACH,wBAFU,OAAO,CAEkB;CAlBlC;wCA5CuC,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AchievementGateway.d.ts","sourceRoot":"","sources":["../../../../src/engine/achievements/AchievementGateway.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAKI;;;OAGG;IACH,eAFa,QAAQ,
|
|
1
|
+
{"version":3,"file":"AchievementGateway.d.ts","sourceRoot":"","sources":["../../../../src/engine/achievements/AchievementGateway.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAKI;;;OAGG;IACH,eAFa,QAAQ,MAAM,EAAE,CAAC,CAK7B;IAED;;;;OAIG;IACH,iCAGC;CACJ"}
|
|
@@ -8,7 +8,7 @@ export class AchievementGateway {
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Retrieve list of unlocked achievements
|
|
11
|
-
* @returns {Promise<
|
|
11
|
+
* @returns {Promise<string[]>} IDs of unlocked achievements
|
|
12
12
|
*/
|
|
13
13
|
getUnlocked() {
|
|
14
14
|
//needs to be overridden in subclass
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AchievementManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/achievements/AchievementManager.js"],"names":[],"mappings":"AA0CA;IAGQ,WAAwB;IAExB;;;OAGG;IACH,SAFU,qBAAmB,IAAI,CAEd;IAEnB;;;OAGG;IACH,SAFU,WAAW,EAAE,CAEN;IAGjB;;;OAGG;IACH,cAFU,eAAa,IAAI,CAEH;IAExB;;;OAGG;IACH,YAFU,aAAW,IAAI,CAEH;IAEtB;;;OAGG;IACH,eAFU,gBAAc,IAAI,CAEH;IAEzB;;;OAGG;IACH,cAFU,eAAa,IAAI,CAEH;IAExB;;;OAGG;IACH,oBAFU,eAAe,CAEkB;IAG3C;;;OAGG;IACH,+BAFU,eAAe,CAE6B;IAEtD;;;OAGG;IACH,+BAFU,eAAe,CAE6B;IAEtD;;;OAGG;IACH,mBAFU,WAAW,CAKpB;IAUD,aAAkB;IAGtB;;;;OAIG;IACH,gCAFY,WAAW,GAAC,SAAS,CAIhC;IAGD;;;OAGG;IACH,yBA6BC;IAED;;;OAGG;IACH,sBAcC;IAED;;;OAGG;IACH,wBAUC;IAGD;;OAEG;IACH,iBAUC;IAED;;OAEG;IACH,mBAMC;IAED,uCAMC;IAED;;;OAGG;IACH,0DA6BC;IAED;;;OAGG;IACH,qBAFW,WAAW,
|
|
1
|
+
{"version":3,"file":"AchievementManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/achievements/AchievementManager.js"],"names":[],"mappings":"AA0CA;IAGQ,WAAwB;IAExB;;;OAGG;IACH,SAFU,qBAAmB,IAAI,CAEd;IAEnB;;;OAGG;IACH,SAFU,WAAW,EAAE,CAEN;IAGjB;;;OAGG;IACH,cAFU,eAAa,IAAI,CAEH;IAExB;;;OAGG;IACH,YAFU,aAAW,IAAI,CAEH;IAEtB;;;OAGG;IACH,eAFU,gBAAc,IAAI,CAEH;IAEzB;;;OAGG;IACH,cAFU,eAAa,IAAI,CAEH;IAExB;;;OAGG;IACH,oBAFU,eAAe,CAEkB;IAG3C;;;OAGG;IACH,+BAFU,eAAe,CAE6B;IAEtD;;;OAGG;IACH,+BAFU,eAAe,CAE6B;IAEtD;;;OAGG;IACH,mBAFU,WAAW,CAKpB;IAUD,aAAkB;IAGtB;;;;OAIG;IACH,gCAFY,WAAW,GAAC,SAAS,CAIhC;IAGD;;;OAGG;IACH,yBA6BC;IAED;;;OAGG;IACH,sBAcC;IAED;;;OAGG;IACH,wBAUC;IAGD;;OAEG;IACH,iBAUC;IAED;;OAEG;IACH,mBAMC;IAED,uCAMC;IAED;;;OAGG;IACH,0DA6BC;IAED;;;OAGG;IACH,qBAFW,WAAW,QA4FrB;IAED;;;OAGG;IACH,+CAGC;IAED,mCAoDC;IAED,yBAOC;IAED,0BAEC;CACJ;6BAra4B,2BAA2B;4BAG5B,kBAAkB;4BAxBlB,qCAAqC;4BACrC,sDAAsD"}
|
|
@@ -335,10 +335,9 @@ export class AchievementManager extends EnginePlugin {
|
|
|
335
335
|
})
|
|
336
336
|
]);
|
|
337
337
|
|
|
338
|
-
const cBehavior =
|
|
338
|
+
const cBehavior = BehaviorComponent.fromOne(sequenceBehavior);
|
|
339
339
|
//use system clock for behavior
|
|
340
340
|
cBehavior.clock = ClockChannelType.Simulation;
|
|
341
|
-
cBehavior.list.push(sequenceBehavior);
|
|
342
341
|
|
|
343
342
|
const guiElement = GUIElement.fromView(achievementView);
|
|
344
343
|
|
|
@@ -379,6 +378,10 @@ export class AchievementManager extends EnginePlugin {
|
|
|
379
378
|
}
|
|
380
379
|
|
|
381
380
|
async initializeGateway() {
|
|
381
|
+
/**
|
|
382
|
+
*
|
|
383
|
+
* @type {string[]}
|
|
384
|
+
*/
|
|
382
385
|
const unlockedIds = await this.gateway.getUnlocked();
|
|
383
386
|
|
|
384
387
|
//de-activate unlocked achievements
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageAchievementGateway.d.ts","sourceRoot":"","sources":["../../../../../src/engine/achievements/gateway/StorageAchievementGateway.js"],"names":[],"mappings":"AAGA;IACI;;;;OAIG;IACH,qBAHW,OAAO,gBAWjB;IALG,iBAAsB;IAEtB,YAAc;IAEd,oBAA6B;IAGjC,
|
|
1
|
+
{"version":3,"file":"StorageAchievementGateway.d.ts","sourceRoot":"","sources":["../../../../../src/engine/achievements/gateway/StorageAchievementGateway.js"],"names":[],"mappings":"AAGA;IACI;;;;OAIG;IACH,qBAHW,OAAO,gBAWjB;IALG,iBAAsB;IAEtB,YAAc;IAEd,oBAA6B;IAGjC,4BAiBC;IAED,+BAmCC;CACJ;mCAzEkC,0BAA0B"}
|
|
@@ -19,15 +19,20 @@ export class StorageAchievementGateway extends AchievementGateway {
|
|
|
19
19
|
|
|
20
20
|
getUnlocked() {
|
|
21
21
|
return new Promise((resolve, reject) => {
|
|
22
|
-
this.storage.load(this.key,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
this.storage.load(this.key,
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param {string[]|undefined} list
|
|
26
|
+
*/
|
|
27
|
+
(list) => {
|
|
28
|
+
|
|
29
|
+
if (list === undefined) {
|
|
30
|
+
resolve([]);
|
|
31
|
+
} else {
|
|
32
|
+
resolve(list);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}, reject, noop);
|
|
31
36
|
});
|
|
32
37
|
}
|
|
33
38
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BehaviorComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/BehaviorComponent.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BehaviorComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/BehaviorComponent.js"],"names":[],"mappings":"AAKA;IA6EI;;;;;OAKG;IACH,gDAFa,iBAAiB,CAM7B;IAED;;;;OAIG;IACH,6BAFa,iBAAiB,CAa7B;IAvGD;;;OAGG;IACH,OAFU,gBAAgB,GAAC,MAAM,CAEG;IAEpC;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,mBAAkB;IAElB;;;;OAIG;IACH,cAHW,MAAM,wBAAsB,GAC1B,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,wBAAsB,GAC1B,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,wBAAsB,SAC5B,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM,wBAAsB,GAC1B,OAAO,CAInB;IAUD;;;OAGG;IACH,uBAEC;IAdD;;;OAGG;IACH,oBAEC;CAuCJ;;sBAIS,OAAO;kBAMP,MAAM;;iCAtHiB,uBAAuB"}
|
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
|
-
import { ClockChannelType } from "./ClockChannelType.js";
|
|
3
2
|
import { RepeatBehavior } from "../decorator/RepeatBehavior.js";
|
|
4
3
|
import { ActionBehavior } from "../primitive/ActionBehavior.js";
|
|
5
|
-
import {
|
|
4
|
+
import { ClockChannelType } from "./ClockChannelType.js";
|
|
6
5
|
|
|
7
6
|
export class BehaviorComponent {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.__behavior = null;
|
|
28
|
-
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* What clock should be used for ticking associated behavior
|
|
10
|
+
* @type {ClockChannelType|number}
|
|
11
|
+
*/
|
|
12
|
+
clock = ClockChannelType.Simulation;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @type {number}
|
|
17
|
+
*/
|
|
18
|
+
flags = 0;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @type {Behavior|null}
|
|
23
|
+
* @private
|
|
24
|
+
*/
|
|
25
|
+
__behavior = null;
|
|
29
26
|
|
|
30
27
|
/**
|
|
31
28
|
*
|
|
@@ -83,35 +80,6 @@ export class BehaviorComponent {
|
|
|
83
80
|
this.__behavior = v;
|
|
84
81
|
}
|
|
85
82
|
|
|
86
|
-
/**
|
|
87
|
-
* @deprecated
|
|
88
|
-
* @returns {Readonly<Behavior[]>}
|
|
89
|
-
*/
|
|
90
|
-
get list() {
|
|
91
|
-
if (this.__behavior !== null) {
|
|
92
|
-
return [this.__behavior];
|
|
93
|
-
} else {
|
|
94
|
-
return [];
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @deprecated
|
|
100
|
-
* @param {Behavior[]} v
|
|
101
|
-
*/
|
|
102
|
-
set list(v) {
|
|
103
|
-
console.warn('.list is deprecated, use SequenceBehavior instead');
|
|
104
|
-
if (v.length > 1) {
|
|
105
|
-
console.warn('.list is deprecated, converting to sequence instead');
|
|
106
|
-
this.__behavior = SequenceBehavior.from(v);
|
|
107
|
-
} else if (v.length === 1) {
|
|
108
|
-
this.__behavior = v[0];
|
|
109
|
-
} else {
|
|
110
|
-
this.__behavior = null;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
83
|
/**
|
|
116
84
|
*
|
|
117
85
|
* @param {function(timeDelta:number)} f
|
|
@@ -130,8 +98,8 @@ export class BehaviorComponent {
|
|
|
130
98
|
* @returns {BehaviorComponent}
|
|
131
99
|
*/
|
|
132
100
|
static fromOne(b) {
|
|
133
|
-
assert.defined(b,
|
|
134
|
-
assert.notNull(b,
|
|
101
|
+
assert.defined(b, 'behavior');
|
|
102
|
+
assert.notNull(b, 'behavior');
|
|
135
103
|
assert.equal(b.isBehavior, true, 'b.isBehavior !== true');
|
|
136
104
|
|
|
137
105
|
const result = new BehaviorComponent();
|