Documentation
¶
Index ¶
- Constants
- func CanHu(onHand Indexes, discard int) bool
- func CheckWin(indexes Indexes) bool
- func IndexFromID(id int) int
- func IsTing(onHand Indexes) bool
- func MaxMultiple(opts *protocol.DeskOptions, onHand, pongKong Indexes) (multiple int, index int)
- func Multiple(ctx *Context, onHand, pongKong Indexes) int
- func RemoveId(m *Mahjong, tid int)
- type Context
- type IndexInfo
- type Indexes
- func (indexes Indexes) Mark(is ...int)
- func (indexes Indexes) Reset()
- func (indexes Indexes) Sort()
- func (indexes Indexes) String() string
- func (indexes Indexes) TileString(i int) string
- func (indexes Indexes) Unmark(is ...int)
- func (indexes Indexes) Unmarked() ([14]IndexInfo, int)
- func (indexes Indexes) UnmarkedCount() int
- func (indexes Indexes) UnmarkedSequence() ([3]IndexInfo, int)
- func (indexes Indexes) UnmarkedString() string
- func (indexes Indexes) UnmarkedTriplet() ([3]IndexInfo, int)
- type Mahjong
- type ReadyTile
- type Result
- type ScoreChangeType
- type Stats
- type Tile
- type Tiles
Constants ¶
View Source
const ( PingHu = iota PongPong // 碰碰胡:由4副刻子(或杠)、将牌组成的胡牌 QiDui // 七对: 7个对子组成的的胡牌 LongQiDui ShuangLongQiDui HaoHuaLongQiDui QYS // 清一色:由一种花色的牌组成的胡牌 HaiDiLao // 海底捞:抓棹面上最后一张牌的人正好能胡牌 GangShangHua // 杠上花: 杠来自己要胡的牌胡牌 )
View Source
const ( MaxFan = -1 // 极品 MeiHu = -2 // 没胡牌 )
View Source
const (
IllegalIndex = -1
)
View Source
const MaxTileIndex = 29
每种花色(条,筒)最多9种牌型,但牌是没有0点的共计 9+9 1-9: 条 11-19: 筒 21-29: 万
Variables ¶
This section is empty.
Functions ¶
func IndexFromID ¶
func MaxMultiple ¶
func MaxMultiple(opts *protocol.DeskOptions, onHand, pongKong Indexes) (multiple int, index int)
返回听牌最大番数
Types ¶
type Context ¶
type Context struct { WinningID int //自己要和的牌 PrevOp int //上一个操作 NewDrawingID int //最新上手的牌 NewOtherDiscardID int //上家打出的最新一张牌 LastDiscardId int // 最新打过的牌 Desc []string // 描述 IsLastTile bool //自己上手的最新一张牌,是否是桌面上的最后一张 LastHint *protocol.Hint //最后一次提示 ResultType int Opts *protocol.DeskOptions DeskNo string Uid int64 Fan int // 番数, -1表示极品 Que int // 定缺,0表示未定缺,1表示缺条/2缺筒/3缺万 IsGangShangHua bool // 是不是杠上花 IsGangShangPao bool // 是不是杠上炮 IsQiangGangHu bool // 是不是抢杠胡 }
type Indexes ¶
type Indexes []int // 麻将的index
func (Indexes) TileString ¶
func (Indexes) UnmarkedCount ¶
func (Indexes) UnmarkedSequence ¶
返回一个刻子, 并返回数量
func (Indexes) UnmarkedString ¶
func (Indexes) UnmarkedTriplet ¶
type ScoreChangeType ¶
type ScoreChangeType byte
type Tile ¶
func TileFromIndex ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.