@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.
@@ -1,5 +1,5 @@
1
- import { KIND, Round, Wind } from "../constants";
2
- import { Tile, BlockPon, BlockChi, BlockShoKan, BlockAnKan, BlockDaiKan, Kind, Block } from "../parser";
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
- [KIND.M]: FixedNumber;
17
- [KIND.S]: FixedNumber;
18
- [KIND.P]: FixedNumber;
19
- [KIND.Z]: [number, number, number, number, number, number, number, number];
20
- [KIND.BACK]: [number];
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: Kind): 1 | 8 | 10;
36
- sum(k: Kind): number;
37
- get(k: Kind, n: number): number;
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 commonByKind;
54
+ private commonByType;
56
55
  private groupRemainingTiles;
57
56
  private calcCommon;
58
57
  }
59
- export declare class ExShantenCalculator {
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 commonByKind;
68
+ private commonByType;
78
69
  }
79
70
  export interface BoardParams {
80
71
  doraMarkers: Tile[];