Documentation ¶
Index ¶
Constants ¶
const ( // InstanceCount is a number of tiles. Results to 136. InstanceCount = TileCount * 4 // InstanceBegin is a first valid tile. InstanceBegin Instance = 1 // InstanceEnd is a tile after the last valid tile. // Use for iteration `for i:= InstanceBegin; i < InstanceEnd; i++` // or for validating valid ranges. InstanceEnd Instance = InstanceBegin + Instance(InstanceCount) // InstanceNull is a special value for indicating empty (no instance). InstanceNull Instance = 0 NullCopy CopyID = -1 AnyCopy CopyID = 0 )
Variables ¶
This section is empty.
Functions ¶
func TenhoTypeToString ¶
func TilesToTenhouString ¶
Types ¶
type CopyID ¶
type CopyID int
CopyID is a number of tile inside a group. Values are [0-3]. For example there are 4 tiles of 1 Man.
type Instance ¶
type Instance int
Instance is a representation of one of 136 tiles in mahjong, including their copies. Instance values starts from value of `1` and ends with value of `136`. Value `0` (InstanceNull) used for `undefined` (not set). Four sequenced numbers indicates same tile. Ex. 1,2,3,4 is for 1 Man, 5,6,7,8 is for 2 Man, etc. Tiles order is the following: - `123456789` `Man` (numbers 1-36) - `123456789` `Pin` (numbers 37-72) - `123456789` `Sou` (numbers 73-108) - `East`, `South`, `West`, `East` (numbers 109-124) - `White`, `Green`, `Red` (numbers 125-136). Take note, that for the last group values starts from `White` (not `Red`, as stated in some manuals) See also Tile.
type Instances ¶
type Instances []Instance
type Tile ¶
type Tile int
Tile is a representation of an uniqe tile. THere are 34 unique tiles. Tile values starts from value of `1` and ends with value of `34`. Value `0` (TileNull) used for `undefined` (not set). Tiles order is the following: - `123456789` `Man` (numbers 1-9) - `123456789` `Pin` (numbers 10-18) - `123456789` `Sou` (numbers 19-27) - `East`, `South`, `West`, `East` (numbers 28-31) - `White`, `Green`, `Red` (numbers 32-34) Take note, that for the last group values starts from `White` (not `Red`, as stated in some manuals) See also Instance.
const ( TileNull Tile = iota Man1 Man2 Man3 Man4 Man5 Man6 Man7 Man8 Man9 Pin1 Pin2 Pin3 Pin4 Pin5 Pin6 Pin7 Pin8 Pin9 Sou1 Sou2 Sou3 Sou4 Sou5 Sou6 Sou7 Sou8 Sou9 East South West North White Green Red TileEnd )
Tile numberation starts from 1