labag 1.0.10 → 1.0.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.
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { AllDataType } from "..";
|
|
1
2
|
import { BaseLaBaG } from "./BaseLaBaG";
|
|
2
3
|
export declare class JsonLaBaG extends BaseLaBaG {
|
|
3
|
-
jsonData:
|
|
4
|
+
jsonData: AllDataType;
|
|
4
5
|
dataIndex: number;
|
|
5
6
|
constructor();
|
|
6
|
-
SetupData(data:
|
|
7
|
+
SetupData(data: AllDataType): void;
|
|
7
8
|
Reset(): void;
|
|
8
9
|
Random(): void;
|
|
9
10
|
Result(): void;
|
package/dist/types/JsonLaBaG.js
CHANGED
|
@@ -10,14 +10,14 @@ class JsonLaBaG extends BaseLaBaG_1.BaseLaBaG {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
super();
|
|
12
12
|
this.jsonData = {};
|
|
13
|
-
this.dataIndex =
|
|
13
|
+
this.dataIndex = 1;
|
|
14
14
|
}
|
|
15
15
|
SetupData(data) {
|
|
16
16
|
this.jsonData = data;
|
|
17
17
|
}
|
|
18
18
|
Reset() {
|
|
19
19
|
super.Reset();
|
|
20
|
-
this.dataIndex =
|
|
20
|
+
this.dataIndex = 1;
|
|
21
21
|
}
|
|
22
22
|
Random() {
|
|
23
23
|
const currData = this.jsonData[`${this.dataIndex}`];
|
|
@@ -33,7 +33,7 @@ class JsonLaBaG extends BaseLaBaG_1.BaseLaBaG {
|
|
|
33
33
|
__1.Modes.SuperHHH.RandNum = currData["SuperHHH"] ?? 0;
|
|
34
34
|
__1.Modes.GreenWei.RandNum = currData["GreenWei"] ?? 0;
|
|
35
35
|
const RateRange = this.RateRanges[this.NowMode()];
|
|
36
|
-
const PCodes =
|
|
36
|
+
const PCodes = Array.from(P_1.P.Map.keys());
|
|
37
37
|
RandNums.forEach((RandNum, i) => {
|
|
38
38
|
const code = PCodes.find((_, j) => RandNum <= RateRange[j]);
|
|
39
39
|
if (code) {
|
package/package.json
CHANGED
package/src/types/JsonLaBaG.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { P } from "./P";
|
|
2
|
-
import { Modes } from "..";
|
|
2
|
+
import { AllDataType, Modes } from "..";
|
|
3
3
|
import { BaseLaBaG } from "./BaseLaBaG";
|
|
4
4
|
|
|
5
5
|
export class JsonLaBaG extends BaseLaBaG {
|
|
6
|
-
jsonData:
|
|
6
|
+
jsonData: AllDataType;
|
|
7
7
|
dataIndex: number;
|
|
8
8
|
constructor() {
|
|
9
9
|
super();
|
|
10
10
|
this.jsonData = {};
|
|
11
|
-
this.dataIndex =
|
|
11
|
+
this.dataIndex = 1;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
SetupData(data:
|
|
14
|
+
SetupData(data: AllDataType): void {
|
|
15
15
|
this.jsonData = data;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
Reset(): void {
|
|
19
19
|
super.Reset();
|
|
20
|
-
this.dataIndex =
|
|
20
|
+
this.dataIndex = 1;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
Random(): void {
|
|
@@ -37,7 +37,7 @@ export class JsonLaBaG extends BaseLaBaG {
|
|
|
37
37
|
Modes.GreenWei.RandNum = currData["GreenWei"] ?? 0;
|
|
38
38
|
|
|
39
39
|
const RateRange = this.RateRanges[this.NowMode()];
|
|
40
|
-
const PCodes =
|
|
40
|
+
const PCodes = Array.from(P.Map.keys());
|
|
41
41
|
|
|
42
42
|
RandNums.forEach((RandNum, i) => {
|
|
43
43
|
const code = PCodes.find((_, j) => RandNum <= RateRange[j]);
|