@konoui/mjimage 0.0.6 → 0.0.10
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/dist/mjs/lib/calculator/index.d.ts +14 -23
- package/dist/mjs/lib/calculator/index.js +175 -195
- package/dist/mjs/lib/constants.d.ts +1 -1
- package/dist/mjs/lib/constants.js +2 -2
- package/dist/mjs/lib/controller/controller.js +47 -47
- package/dist/mjs/lib/controller/efficiency.js +25 -24
- package/dist/mjs/lib/controller/managers.d.ts +2 -2
- package/dist/mjs/lib/controller/managers.js +15 -15
- package/dist/mjs/lib/controller/state-machine.js +1 -1
- package/dist/mjs/lib/controller/wall.js +11 -11
- package/dist/mjs/lib/image.js +7 -7
- package/dist/mjs/lib/mjai/event.js +12 -12
- package/dist/mjs/lib/parser.d.ts +5 -5
- package/dist/mjs/lib/parser.js +48 -46
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Tile, BlockPon, BlockChi, BlockShoKan, BlockAnKan, BlockDaiKan,
|
|
1
|
+
import { TYPE, Round, Wind } from "../constants";
|
|
2
|
+
import { Tile, BlockPon, BlockChi, BlockShoKan, BlockAnKan, BlockDaiKan, Type, Block } from "../parser";
|
|
3
3
|
type FixedNumber = [
|
|
4
4
|
number,
|
|
5
5
|
number,
|
|
@@ -13,18 +13,18 @@ type FixedNumber = [
|
|
|
13
13
|
number
|
|
14
14
|
];
|
|
15
15
|
export interface HandData {
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
16
|
+
[TYPE.M]: FixedNumber;
|
|
17
|
+
[TYPE.S]: FixedNumber;
|
|
18
|
+
[TYPE.P]: FixedNumber;
|
|
19
|
+
[TYPE.Z]: [number, number, number, number, number, number, number, number];
|
|
20
|
+
[TYPE.BACK]: [number];
|
|
21
21
|
called: (BlockChi | BlockPon | BlockAnKan | BlockDaiKan | BlockShoKan)[];
|
|
22
22
|
tsumo: Tile | null;
|
|
23
23
|
reached: boolean;
|
|
24
24
|
}
|
|
25
25
|
export declare class Hand {
|
|
26
26
|
private data;
|
|
27
|
-
constructor(input: string);
|
|
27
|
+
constructor(input: string, allowBackBlock?: boolean);
|
|
28
28
|
private init;
|
|
29
29
|
get hands(): Tile[];
|
|
30
30
|
toString(): string;
|
|
@@ -32,9 +32,9 @@ export declare class Hand {
|
|
|
32
32
|
get reached(): boolean;
|
|
33
33
|
get drawn(): Tile | null;
|
|
34
34
|
get menzen(): boolean;
|
|
35
|
-
getArrayLen(k:
|
|
36
|
-
sum(k:
|
|
37
|
-
get(k:
|
|
35
|
+
getArrayLen(k: Type): 1 | 8 | 10;
|
|
36
|
+
sum(k: Type): number;
|
|
37
|
+
get(k: Type, n: number): number;
|
|
38
38
|
inc(tiles: Tile[]): Tile[];
|
|
39
39
|
dec(tiles: Tile[]): Tile[];
|
|
40
40
|
draw(t: Tile): void;
|
|
@@ -42,7 +42,6 @@ export declare class Hand {
|
|
|
42
42
|
reach(): void;
|
|
43
43
|
call(b: BlockPon | BlockChi | BlockDaiKan): void;
|
|
44
44
|
kan(b: BlockAnKan | BlockShoKan): void;
|
|
45
|
-
get canReach(): boolean;
|
|
46
45
|
clone(): Hand;
|
|
47
46
|
}
|
|
48
47
|
export declare class ShantenCalculator {
|
|
@@ -52,19 +51,11 @@ export declare class ShantenCalculator {
|
|
|
52
51
|
sevenPairs(): number;
|
|
53
52
|
thirteenOrphans(): number;
|
|
54
53
|
fourSetsOnePair(): number;
|
|
55
|
-
private
|
|
54
|
+
private commonByType;
|
|
56
55
|
private groupRemainingTiles;
|
|
57
56
|
private calcCommon;
|
|
58
57
|
}
|
|
59
|
-
export declare class
|
|
60
|
-
h: Hand;
|
|
61
|
-
private c;
|
|
62
|
-
constructor(h: Hand);
|
|
63
|
-
menzen(): number;
|
|
64
|
-
yakuhai(): number;
|
|
65
|
-
tanyao(): void;
|
|
66
|
-
}
|
|
67
|
-
export declare class TileCalculator {
|
|
58
|
+
export declare class BlockCalculator {
|
|
68
59
|
hand: Hand;
|
|
69
60
|
constructor(hand: Hand);
|
|
70
61
|
calc(lastTile: Tile): Block[][];
|
|
@@ -74,7 +65,7 @@ export declare class TileCalculator {
|
|
|
74
65
|
nineGates(): Block[][];
|
|
75
66
|
fourSetsOnePair(): Block[][];
|
|
76
67
|
private commonAll;
|
|
77
|
-
private
|
|
68
|
+
private commonByType;
|
|
78
69
|
}
|
|
79
70
|
export interface BoardParams {
|
|
80
71
|
doraMarkers: Tile[];
|