import "github.com/moxcomic/Archer/gamestate"
| Name | Type | Value | Notes |
|---|
| RoundEndReasonHule | int | 0 | Round ended by winning |
| RoundEndReasonRyuukyoku | int | 1 | Round ended by draw |
| Name | Type | Notes |
|---|
| Reason | int | Reason for round end |
| Deltas | []int | Score changes for players, [0] is self |
| Hules | []*Hules | Win data |
| Name | Type | Notes |
|---|
| Seat | int | Seat number, [0] is self |
| Tsumo | bool | Whether it is a self-draw win |
| Point | int | Points earned |
| Name | Type | Notes |
|---|
| Tile | string | Tile name |
| Tsumogiri | bool | Whether it was tsumogiri |
| Name | Parameters | Return Value | Notes |
|---|
| Inst | None | *gamestate.GameState | GameState singleton instance |
| Name | Parameters | Return Value | Notes |
|---|
| GetChang | None | int | Current round wind: 0=East, 1=South, 2=West |
| GetJu | None | int | Current hand number |
| IsOnChiPon | None | bool | Whether it's in Chii/Pon/Kan phase |
| IsOnBabei | None | bool | Whether it's in Babei phase |
| IsLiqi3 | None | bool | Whether it is three-player mahjong |
| IsInSyncGame | None | bool | Whether this game is a reconnection game |
| IsRoundWind | string | bool | Whether the tile is the round wind |
| IsSelfWind | string | bool | Whether the tile is the player's own wind |
| IsCanWin | None | bool | Whether the player can win |
| GetRanking | None | int | Current ranking (0-indexed) |
| GetLeftTileCount | None | int | Remaining tile count |
| Name | Parameters | Return Value | Notes |
|---|
| GetHandTile | None | []string | Get hand tiles |
| Name | Parameters | Return Value | Notes |
|---|
| GetDiscardTile | None | [][]string | Get discard piles for all four players |
| Name | Parameters | Return Value | Notes |
|---|
| GetLeftTile | None | []string | Get own tile pool |
| GetGlobalLeftTile | None | []string | Get global tile pool |
| Name | Parameters | Return Value | Notes |
|---|
| GetMeld | None | [][]*model.Meld | Get melds for all four players (raw data) |
| Melds | None | [][][]string | Get melds for all four players (string format) |
| GetMeldDiscardAt | None | [][]string | Get meld discard positions |
| Name | Parameters | Return Value | Notes |
|---|
| GetDora | None | []string | Get dora indicators |
| CalcDoraCount | None | int | Calculate current dora count |
| Name | Parameters | Return Value | Notes |
|---|
| GetRiichi | None | []bool | Get riichi status for all four players |
| GetRiichiAt | None | []int | Riichi position in global tile pool, -1 if not declared |
| GetRiichiTsumogiri | None | []bool | Whether each player's riichi was tsumogiri |
| GetCanIppatsu | None | []bool | Whether each player can perform ippatsu |
| Name | Parameters | Return Value | Notes |
|---|
| IsCanOperations | None | bool | Whether any actions can be performed |
| IsCan | int | bool | Whether action (x) can be performed |
| OperationCombination | uint32 | []string | Get combination for operation |
| Name | Parameters | Return Value | Notes |
|---|
| GetRoundEnd | None | *RoundEnd | Get round end information |
| Name | Parameters | Return Value | Notes |
|---|
| GetLatestGlobalDiscardAt | None | []int | Latest global discard position for each player |
| GetEarlyOutside | None | [][]string | Early outside tiles for each player |
| RemainTileCount | string | int | Get remaining count of a specific tile |
| ToLocalSeat | int | int | Convert absolute seat to relative seat |
| ToLocalSeat2 | int, int | int | Convert absolute seat to relative seat (with tw) |
| ToPositionSeat | int | int | Convert relative seat to absolute seat |
| ToPositionSeat2 | int, int | int | Convert relative seat to absolute seat (with tw) |
The following fields can be accessed directly via gamestate.Inst().XXX:
| Name | Type | Notes |
|---|
| Chang | int | Current round wind: 0=East, 1=South, 2=West |
| Ben | int | Current honba count |
| Ju | int | Current hand number |
| Oya | int | Dealer seat number |
| Score | []int32 | Player scores |
| IsSelfChiPon | bool | Whether the player is in chii/pon |
| IsSelfDeal | bool | Whether the player just drew a tile (used for last tile offset) |
| UserUseMouse | bool | Whether the user is using the mouse |
| LastLink | string | Last game replay link |
| Uuid | string | Game UUID |
| Mode | int32 | Game mode |
| Tw | int | Tenhou seat number |
| Level | string | Player level |
| LevelScore | uint32 | Player level score |
| Level3 | string | Three-player level |
| Level3Score | uint32 | Three-player level score |
| IsInSyncGame | bool | Whether this game is a reconnection game |
| IsChangeEngine | bool | Whether engine was switched |
| IsRiichiMoment | bool | Whether it's a riichi moment |
| Uid | string | Logged-in account UID |
| LastDeal | string | Last drawn tile |
| SeatList | []int | Seat list |