import "github.com/moxcomic/Archer/gamestate"
| Name | Type | Value | Notes |
|---|
| RoundEndReasonHule | RoundEndReason | 0 | Round ended by win (hule) |
| RoundEndReasonRyuukyoku | RoundEndReason | 1 | Round ended by draw (ryuukyoku) |
| Name | Type | Notes |
|---|
| RoundEndReason | int alias | Round end reason enum |
| Name | Type | Notes |
|---|
| Reason | RoundEndReason | Reason for round end |
| Deltas | []int | Score changes for players, [0] is self |
| Hules | []*Hules | Win data list |
| Name | Type | Notes |
|---|
| Seat | int | Seat number, [0] is self |
| Tsumo | bool | Self-draw win |
| Point | int | Points earned |
| Name | Type | Notes |
|---|
| Tile | string | Tile name |
| Tsumogiri | bool | Whether discard is tsumogiri |
| Name | Parameters | Return Value | Notes |
|---|
| Inst | None | *gamestate.GameState | GameState singleton instance |
All methods below are from *gamestate.GameState.
| Name | Parameters | Return Value | Notes |
|---|
| GetChang | None | int | Current chang (round wind index) |
| GetJu | None | int | Current ju |
| GetLeftTileCount | None | int | Remaining tile count |
| GetLatestGlobalDiscardAt | None | []int | Latest global discard index per seat |
| GetEarlyOutside | None | [][]string | Early outside tiles per seat |
| GetRanking | None | int | Current rank, zero-based |
| Name | Parameters | Return Value | Notes |
|---|
| GetHandTile | None | []string | Hand tiles |
| AddHandTile | init bool, v ...string | None | Append tiles; sort always, and re-sort when init=true |
| RemoveHandTile | v string | None | Remove one matching tile |
| RemoveHandTiles | v ...string | None | Remove each tile once |
| RemoveHandTiles4 | v string | None | Remove up to 4 copies across normal/aka/deaka |
| ResetHandTile | None | None | Clear hand tiles |
| SortHandTile | None | None | Sort tiles by internal tile order |
| Name | Parameters | Return Value | Notes |
|---|
| GetDiscardTile | None | [][]string | Discard tiles for 4 seats |
| AddDiscardTile | index int, v ...string | None | Append discard(s) to seat index |
| RemoveDiscardTile | index int, v string | None | Remove one matching discard from seat index |
| RemoveDiscardTiles | index int, v ...string | None | Remove each discard once |
| RemoveDiscardTiles4 | index int, v string | None | Remove up to 4 copies across normal/aka/deaka |
| ResetDiscardTile | None | None | Clear all discard piles |
| Name | Parameters | Return Value | Notes |
|---|
| GetLeftTile | None | []string | Current round left-tile stream |
| GetGlobalLeftTile | None | []string | Global left-tile stream |
| AddLeftTile | v ...string | None | Append to both LeftTile and GlobalLeftTile |
| ResetLeftTile | None | None | Clear both streams |
| UndoLeftTile | None | None | Remove latest tile from LeftTile only |
| ResetLeftTileCount | left int | None | Reset remaining tile count |
| UpdateLeftTileCount | None | None | LeftTileCount-- |
| Name | Parameters | Return Value | Notes |
|---|
| GetDora | None | []string | Dora indicators |
| AddDora | v ...string | None | Append dora indicator(s) |
| SetDora | v ...string | None | Replace dora indicators |
| RemoveDora | v string | None | Remove one matching dora indicator |
| RemoveDoras | v ...string | None | Remove each indicator once |
| RemoveDoras4 | v string | None | Remove up to 4 copies across normal/aka/deaka |
| ResetDora | None | None | Clear dora indicators |
| CalcDoraCount | None | int | Count dora in hand and open melds |
| Name | Parameters | Return Value | Notes |
|---|
| GetMeld | None | [][]*model.Meld | Raw meld data (4 seats) |
| Melds | None | [][][]string | Meld tiles converted to string format |
| AddMeld | index int, v ...*model.Meld | None | Append meld(s) for seat index |
| AddMinkan | index int, tiles []string, redFive bool, resetRedFive bool | None | Upgrade matching pon to minkan |
| ResetMeld | None | None | Reset meld container |
| Name | Parameters | Return Value | Notes |
|---|
| GetMeldDiscardAt | None | [][]string | Discards related to chi/pon timing |
| AddMeldDiscardAt | index int, v ...string | None | Append record(s) |
| RemoveMeldDiscardAt | index int, v string | None | Remove one matching record |
| RemoveMeldDiscardAts | index int, v ...string | None | Remove each record once |
| RemoveMeldDiscardAts4 | index int, v string | None | Remove up to 4 copies across normal/aka/deaka |
| ResetMeldDiscardAt | None | None | Clear records for all seats |
| Name | Parameters | Return Value | Notes |
|---|
| SetRiichi | index int, v bool, t bool | None | Set riichi and riichi-tsumogiri state |
| SetRiichiAccept | index int, v bool | None | Set riichi accept flag |
| ResetRiichi | None | None | Reset riichi-related arrays |
| GetRiichi | None | []bool | Riichi flags (4 seats) |
| GetRiichiAt | None | []int | Riichi position in global discard stream |
| GetRiichiTsumogiri | None | []bool | Whether riichi discard was tsumogiri |
| GetCanIppatsu | None | []bool | Ippatsu availability flags |
| ResetRiichiAt | None | None | Reset RiichiAt to [-1,-1,-1,-1] |
| ResetCanIppatsu | None | None | Reset ippatsu flags |
| ResetTenhouFlags | None | None | Reset Tenhou ippatsu helper flags |
| ResetCanIppatsuIndex | i int | None | Clear one seat's ippatsu + Tenhou flag |
| ResetLatestGlobalDiscardAt | None | None | Reset latest global discard indexes |
| Name | Parameters | Return Value | Notes |
|---|
| IsCanOperations | None | bool | Whether operation list is non-empty |
| IsOperation | target uint32 | bool | Whether target op exists |
| OperationCombination | target uint32 | []string | Return matched operation combinations |
| IsCan | target int | bool | Whether target op exists (int version) |
| SetOperationList | v []*lq.OptionalOperation | None | Setter kept for yaegi compatibility |
| Name | Parameters | Return Value | Notes |
|---|
| IsLiqi3 | None | bool | Whether it is three-player mahjong |
| 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 |
| Name | Parameters | Return Value | Notes |
|---|
| ResetAssassin | None | None | Reset internal tile-remaining counters |
| AssassinTileCount | t string | None | Consume one tile from counters |
| AssassinTileCounts | tiles []string | None | Consume multiple tiles |
| RemainTileCount | tile string | int | Remaining copies for one tile |
| Name | Parameters | Return Value | Notes |
|---|
| ToLocalSeat | seat int | int | Absolute seat -> local seat |
| ToLocalSeat2 | seat int, tw int | int | Absolute seat -> local seat with custom tw |
| ToPositionSeat | seat int | int | Local seat -> absolute seat |
| ToPositionSeat2 | seat int, tw int | int | Local seat -> absolute seat with custom tw |
| Name | Parameters | Return Value | Notes |
|---|
| EncodeAccountId | None | int | Encode account id used in Majsoul paipu link |
| SetLastLink | None | None | Build and set LastLink from current platform/uuid |
| SetUuid | v string | None | Setter kept for yaegi compatibility |
| AddEarlyOutside | index int, tile string | None | Add one early outside tile |
| ResetEarlyOutside | None | None | Reset early outside tile record |
| ResetScore | None | None | Reset score to [25000,25000,25000,25000] |
The following fields are exported and can be accessed directly via gamestate.Inst().XXX:
| Name | Type | Notes |
|---|
| HandLock | sync.Mutex | Hand tile mutex |
| HandTile | []string | Player hand tiles |
| LeftLock | sync.Mutex | Left-tile mutex |
| LeftTile | []string | Left-tile stream |
| GlobalLeftTile | []string | Global left-tile stream |
| DiscardLock | sync.Mutex | Discard mutex |
| DiscardTile | [][]string | Discard tiles per seat |
| MeldLock | sync.Mutex | Meld mutex |
| Meld | [][]*model.Meld | Melds per seat |
| MeldDiscardAtLock | sync.Mutex | Meld-discard-at mutex |
| MeldDiscardAt | [][]string | Meld discard records |
| DoraLock | sync.Mutex | Dora mutex |
| Dora | []string | Dora indicators |
| Riichi | []bool | Riichi flags |
| RiichiAccept | []bool | Riichi accepted flags |
| RiichiTsumogiri | []bool | Riichi tsumogiri flags |
| RiichiAt | []int | Riichi positions in global stream |
| LatestDiscard | int | Latest discard seat |
| LatestGlobalDiscardAt | []int | Latest global discard index per seat |
| CanIppatsu | []bool | Ippatsu flags |
| TenhouIppatsuFlag | []bool | Tenhou helper flags |
| EarlyOutside | [][]string | Early outside tiles per seat |
| IsOnChiPon | bool | Current state is chi/pon flow |
| IsOnBabei | bool | Current state is babei flow |
| 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 |
| LeftTileCount | int | Remaining tile count |
| IsSelfChiPon | bool | Whether the player is in chii/pon |
| IsSelfDeal | bool | Whether the player just drew a tile (used for last tile offset) |
| OperationList | []*lq.OptionalOperation | Current operation list |
| UserUseMouse | bool | Whether the user is using the mouse |
| LastLink | string | Last game replay link |
| Uuid | string | Game UUID |
| Mode | int32 | Game mode |
| OnTenhouLobby | bool | Whether on Tenhou lobby |
| OnTenhouGame | bool | Whether on Tenhou game |
| Tw | int | Tenhou seat number |
| LastLevel | uint32 | Last known level id |
| 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 |
| ResAuthGame | *lq.ResAuthGame | Auth game payload |
| Round | *lq.ActionNewRound | Latest new-round action payload |
| RoundEndData | *RoundEnd | Last round-end snapshot |
| Tile37 | []int | Tile remaining counter (37-index style) |
| TilesSeen | [34]uint8 | Seen tile counter (34-index style) |
| Tsumogiri3 | [][]*Tsumogiri | Tsumogiri log for 3p |
| IsChangeEngine | bool | Whether engine was switched |
| IsRiichiMoment | bool | Whether it's a riichi moment |
| TingPaiInfo | []*lq.TingPaiInfo | Tingpai info payload |
| TingPaiDiscardInfo | []*lq.TingPaiDiscardInfo | Tingpai-discard info payload |
| Uid | string | Logged-in account UID |
| LastDeal | string | Last drawn tile |
| SeatList | []int | Seat list |
| Liqi3 | bool | RiichiCity 3-player flag |