wgge 1.0.13 → 1.0.15
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.
|
@@ -10,6 +10,13 @@ export default class NumberHelper {
|
|
|
10
10
|
return min + (diff * Math.random());
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Return true for the given percent of calls.
|
|
15
|
+
*/
|
|
16
|
+
static randomPercent(percent) {
|
|
17
|
+
return NumberHelper.random(0, 100) < percent;
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
/**
|
|
14
21
|
Returns n if n is between min and max. Return min if n lower than min or return max if n is greater than max.
|
|
15
22
|
*/
|
|
@@ -51,7 +51,13 @@ export default class ObjectModel extends ModelBase {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
if (state.p) {
|
|
54
|
-
this.properties.forEach(
|
|
54
|
+
this.properties.forEach(
|
|
55
|
+
(name, property) => {
|
|
56
|
+
if (property.isPersistent) {
|
|
57
|
+
property.restoreState(state.p[name]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
55
61
|
}
|
|
56
62
|
if (state.i !== undefined) {
|
|
57
63
|
this.restoreStateInternal(state.i);
|