Documentation ¶
Overview ¶
Package poker 提供了一组用于处理扑克牌游戏的函数和数据结构。该包旨在简化扑克牌游戏的开发过程,并提供一致的接口和易于使用的功能。
主要特性:
- 扑克牌操作:"poker"包支持处理扑克牌的各种操作,如洗牌、发牌、比较牌面大小等。您可以使用这些操作来模拟和实现各种扑克牌游戏。
- 扑克牌规则:该包提供了一系列函数,用于执行常见的扑克牌规则,如判断是否是同花顺、计算牌面点数等。这些函数旨在提供准确和可靠的规则判断和计算结果。
- 扑克牌算法:"poker"包还提供了一些算法,用于解决扑克牌游戏中的问题,如计算最佳牌型、判断是否存在顺子等。这些算法旨在提供高效和优化的解决方案。
- 简化接口:该包的设计目标之一是提供简化的接口,使扑克牌游戏的开发变得更加直观和易于使用。您可以轻松地创建和操作扑克牌对象,而无需处理繁琐的底层细节。
Deprecated: 从 Minotaur 0.0.25 开始,由于设计原因已弃用,请尝试考虑使用 utils/combination 和 utils/deck 代替
Index ¶
- Constants
- func ColorDifference[P, C generic.Number, T Card[P, C]](card1 T, card2 T) int
- func Equal[P, C generic.Number, T Card[P, C]](card1 T, card2 T) bool
- func EqualColor[P, C generic.Number, T Card[P, C]](card1 T, card2 T) bool
- func EqualPoint[P, C generic.Number, T Card[P, C]](card1 T, card2 T) bool
- func GetCardsColor[P, C generic.Number, T Card[P, C]](cards ...T) []C
- func GetCardsPoint[P, C generic.Number, T Card[P, C]](cards ...T) []P
- func GetPointAndColor[P, C generic.Number, T Card[P, C]](card T) (P, C)
- func GroupByColor[P, C generic.Number, T Card[P, C]](cards ...T) map[C][]T
- func GroupByPoint[P, C generic.Number, T Card[P, C]](cards ...T) map[P][]T
- func IsContain[P, C generic.Number, T Card[P, C]](cards []T, card T) bool
- func IsContainAll[P, C generic.Number, T Card[P, C]](cards []T, cards2 []T) bool
- func IsContainJoker[P, C generic.Number, T Card[P, C]](pile *CardPile[P, C, T], cards ...T) bool
- func IsFlush[P, C generic.Number, T Card[P, C]](cards ...T) bool
- func IsJoker[P, C generic.Number, T Card[P, C]](pile *CardPile[P, C, T], card T) bool
- func IsNeighborColor[P, C generic.Number, T Card[P, C]](card1 T, card2 T) bool
- func IsNeighborPoint[P, C generic.Number, T Card[P, C]](card1 T, card2 T) bool
- func IsRocket[P, C generic.Number, T Card[P, C]](pile *CardPile[P, C, T], cardA, cardB T) bool
- func Max[P, C generic.Number, T Card[P, C]](card1 T, card2 T) T
- func MaxColor[P, C generic.Number, T Card[P, C]](card1 T, card2 T) T
- func MaxPoint[P, C generic.Number, T Card[P, C]](card1 T, card2 T) T
- func Min[P, C generic.Number, T Card[P, C]](card1 T, card2 T) T
- func MinColor[P, C generic.Number, T Card[P, C]](card1 T, card2 T) T
- func MinPoint[P, C generic.Number, T Card[P, C]](card1 T, card2 T) T
- func PointDifference[P, C generic.Number, T Card[P, C]](card1 T, card2 T) int
- type Card
- type CardPile
- func (slf *CardPile[P, C, T]) Cards() []T
- func (slf *CardPile[P, C, T]) Count() int
- func (slf *CardPile[P, C, T]) GetCard(guid int64) T
- func (slf *CardPile[P, C, T]) IsExclude(point P, color C) bool
- func (slf *CardPile[P, C, T]) IsExcludeWithCard(card T) bool
- func (slf *CardPile[P, C, T]) IsFree() bool
- func (slf *CardPile[P, C, T]) Pull(index int) T
- func (slf *CardPile[P, C, T]) PullBottom() T
- func (slf *CardPile[P, C, T]) PullTop() T
- func (slf *CardPile[P, C, T]) Push(index int, card T)
- func (slf *CardPile[P, C, T]) PushBottom(card T)
- func (slf *CardPile[P, C, T]) PushTop(card T)
- func (slf *CardPile[P, C, T]) Reset()
- func (slf *CardPile[P, C, T]) Shuffle()
- type CardPileOption
- func WithCardPileExcludeCard[P, C generic.Number, T Card[P, C]](cards ...Card[P, C]) CardPileOption[P, C, T]
- func WithCardPileExcludeColor[P, C generic.Number, T Card[P, C]](colors ...C) CardPileOption[P, C, T]
- func WithCardPileExcludePoint[P, C generic.Number, T Card[P, C]](points ...P) CardPileOption[P, C, T]
- func WithCardPileShuffle[P, C generic.Number, T Card[P, C]](shuffleHandle func(pile []T) []T) CardPileOption[P, C, T]
- type HandHandle
- func HandBomb[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandFlush[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandFlushStraight[P, C generic.Number, T Card[P, C]](count, lower, limit int) HandHandle[P, C, T]
- func HandFourWithOne[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandFourWithThree[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandFourWithTwo[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandFourWithTwoPairs[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandLeopard[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandOrderFourWithOne[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
- func HandOrderFourWithThree[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
- func HandOrderFourWithTwo[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
- func HandOrderPairs[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
- func HandOrderSingle[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
- func HandOrderSingleFour[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
- func HandOrderSingleThree[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
- func HandOrderThreeWithOne[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
- func HandOrderThreeWithTwo[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
- func HandPairs[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandPlane[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandPlaneWithOne[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandRocket[P, C generic.Number, T Card[P, C]](pile *CardPile[P, C, T]) HandHandle[P, C, T]
- func HandSingle[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandStraightPairs[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandThreeOfKind[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandThreeOfKindWithOne[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandThreeOfKindWithTwo[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- func HandTwoWithOne[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
- type Option
- func WithColorSort[P, C generic.Number, T Card[P, C]](colorSort map[C]int) Option[P, C, T]
- func WithColorValue[P, C generic.Number, T Card[P, C]](colorValues map[C]int) Option[P, C, T]
- func WithExcludeContinuityPoint[P, C generic.Number, T Card[P, C]](points ...P) Option[P, C, T]
- func WithHand[P, C generic.Number, T Card[P, C]](pokerHand string, value int, handle HandHandle[P, C, T]) Option[P, C, T]
- func WithHandRestraint[P, C generic.Number, T Card[P, C]](pokerHand, restraint string) Option[P, C, T]
- func WithHandRestraintFull[P, C generic.Number, T Card[P, C]](pokerHand string) Option[P, C, T]
- func WithPointSort[P, C generic.Number, T Card[P, C]](pointSort map[P]int) Option[P, C, T]
- func WithPointValue[P, C generic.Number, T Card[P, C]](pointValues map[P]int) Option[P, C, T]
- type Rule
- func (slf *Rule[P, C, T]) CompareValueWithCards(cards1 []T, expression maths.CompareExpression, cards2 []T) bool
- func (slf *Rule[P, C, T]) GetCardCount(cards []T, card T) int
- func (slf *Rule[P, C, T]) GetCardCountWithColor(cards []T, color C) int
- func (slf *Rule[P, C, T]) GetCardCountWithColorMaximumNumber(cards []T, color C, maximumNumber int) int
- func (slf *Rule[P, C, T]) GetCardCountWithMaximumNumber(cards []T, card T, maximumNumber int) int
- func (slf *Rule[P, C, T]) GetCardCountWithPoint(cards []T, point P) int
- func (slf *Rule[P, C, T]) GetCardCountWithPointMaximumNumber(cards []T, point P, maximumNumber int) int
- func (slf *Rule[P, C, T]) GetValueWithCards(cards ...T) int
- func (slf *Rule[P, C, T]) GetValueWithColor(color C) int
- func (slf *Rule[P, C, T]) GetValueWithPoint(point P) int
- func (slf *Rule[P, C, T]) GetValueWithPokerHand(hand string, cards ...T) int
- func (slf *Rule[P, C, T]) IsPointContinuity(count int, cards ...T) bool
- func (slf *Rule[P, C, T]) IsSameColor(cards ...T) bool
- func (slf *Rule[P, C, T]) IsSamePoint(cards ...T) bool
- func (slf *Rule[P, C, T]) PokerHand(cards ...T) (pokerHand string, hit bool)
- func (slf *Rule[P, C, T]) PokerHandIsMatch(cardsA, cardsB []T) bool
- func (slf *Rule[P, C, T]) SortByColorAsc(cards []T) []T
- func (slf *Rule[P, C, T]) SortByColorDesc(cards []T) []T
- func (slf *Rule[P, C, T]) SortByPointAsc(cards []T) []T
- func (slf *Rule[P, C, T]) SortByPointDesc(cards []T) []T
Constants ¶
const (
HandNone = "None" // 无牌型
)
Variables ¶
This section is empty.
Functions ¶
func ColorDifference ¶ added in v0.0.20
ColorDifference 计算两张扑克牌的花色差
func EqualColor ¶ added in v0.0.20
EqualColor 比较两张扑克牌的花色是否相同
func EqualPoint ¶ added in v0.0.20
EqualPoint 比较两张扑克牌的点数是否相同
func GetCardsColor ¶
GetCardsColor 获取一组扑克牌的花色
func GetCardsPoint ¶
GetCardsPoint 获取一组扑克牌的点数
func GetPointAndColor ¶ added in v0.0.20
GetPointAndColor 返回扑克牌的点数和花色
func GroupByColor ¶ added in v0.0.3
GroupByColor 将扑克牌按照花色分组
func GroupByPoint ¶ added in v0.0.3
GroupByPoint 将扑克牌按照点数分组
func IsContainAll ¶ added in v0.0.20
IsContainAll 一组扑克牌是否包含另一组扑克牌
func IsContainJoker ¶ added in v0.0.3
IsContainJoker 检查扑克牌是否包含大小王
func IsNeighborColor ¶ added in v0.0.20
IsNeighborColor 判断两张扑克牌是否为相邻的花色
func IsNeighborPoint ¶ added in v0.0.20
IsNeighborPoint 判断两张扑克牌是否为相邻的点数
Types ¶
type Card ¶
type Card[P, C generic.Number] interface { // GetGuid 获取扑克牌的唯一标识 GetGuid() int64 // GetPoint 获取扑克牌的点数 GetPoint() P // GetColor 获取扑克牌的花色 GetColor() C }
Card 扑克牌
type CardPile ¶
type CardPile[P, C generic.Number, T Card[P, C]] struct { // contains filtered or unexported fields }
CardPile 扑克牌堆
func NewCardPile
deprecated
func NewCardPile[P, C generic.Number, T Card[P, C]](size int, jokers [2]P, points [13]P, colors [4]C, generateCard func(guid int64, point P, color C) T, options ...CardPileOption[P, C, T]) *CardPile[P, C, T]
NewCardPile 返回一个新的牌堆,其中 size 表示了该牌堆由多少副牌组成
- 在不洗牌的情况下,默认牌堆顶部到底部为从大到小排列
Deprecated: 从 Minotaur 0.0.25 开始,由于设计原因已弃用,请尝试考虑使用 deck.Deck 或 deck.Group 代替,构建函数为 deck.NewDeck 或 deck.NewGroup
func (*CardPile[P, C, T]) IsExcludeWithCard ¶
IsExcludeWithCard 检查特定扑克牌是否被排除在外
func (*CardPile[P, C, T]) PullBottom ¶
func (slf *CardPile[P, C, T]) PullBottom() T
PullBottom 从牌堆底部抽出一张牌
func (*CardPile[P, C, T]) PushBottom ¶
func (slf *CardPile[P, C, T]) PushBottom(card T)
PushBottom 将扑克牌插入到牌堆底部
type CardPileOption ¶
func WithCardPileExcludeCard ¶
func WithCardPileExcludeCard[P, C generic.Number, T Card[P, C]](cards ...Card[P, C]) CardPileOption[P, C, T]
WithCardPileExcludeCard 通过排除特定扑克牌的方式创建牌堆
func WithCardPileExcludeColor ¶
func WithCardPileExcludeColor[P, C generic.Number, T Card[P, C]](colors ...C) CardPileOption[P, C, T]
WithCardPileExcludeColor 通过排除特定花色的方式创建牌堆
func WithCardPileExcludePoint ¶
func WithCardPileExcludePoint[P, C generic.Number, T Card[P, C]](points ...P) CardPileOption[P, C, T]
WithCardPileExcludePoint 通过排除特定点数的方式创建牌堆
func WithCardPileShuffle ¶
func WithCardPileShuffle[P, C generic.Number, T Card[P, C]](shuffleHandle func(pile []T) []T) CardPileOption[P, C, T]
WithCardPileShuffle 通过特定的洗牌算法创建牌堆
- 需要保证洗牌后的牌堆剩余扑克数量与之前相同,否则将会引发 panic
type HandHandle ¶
HandHandle 扑克牌型验证函数
func HandBomb ¶ added in v0.0.3
func HandBomb[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandBomb 炸弹
func HandFlush ¶ added in v0.0.3
func HandFlush[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandFlush 同花
- 表示所有牌的花色都相同
func HandFlushStraight ¶ added in v0.0.3
func HandFlushStraight[P, C generic.Number, T Card[P, C]](count, lower, limit int) HandHandle[P, C, T]
HandFlushStraight 同花顺
- count: 顺子的对子数量,例如当 count = 2 时,可以是 334455、445566、556677、667788、778899
- lower: 顺子的最小连续数量
- limit: 顺子的最大连续数量
func HandFourWithOne ¶ added in v0.0.3
func HandFourWithOne[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandFourWithOne 四带一
func HandFourWithThree ¶ added in v0.0.3
func HandFourWithThree[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandFourWithThree 四带三
func HandFourWithTwo ¶ added in v0.0.3
func HandFourWithTwo[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandFourWithTwo 四带二
func HandFourWithTwoPairs ¶ added in v0.0.3
func HandFourWithTwoPairs[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandFourWithTwoPairs 四带两对
func HandLeopard ¶ added in v0.0.3
func HandLeopard[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandLeopard 豹子
- 表示三张点数相同的牌
- 例如:333、444、555、666、777、888、999、JJJ、QQQ、KKK、AAA
- 大小王不能用于豹子,因为他们没有点数
func HandOrderFourWithOne ¶ added in v0.0.3
func HandOrderFourWithOne[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
HandOrderFourWithOne 四带一顺子
func HandOrderFourWithThree ¶ added in v0.0.3
func HandOrderFourWithThree[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
HandOrderFourWithThree 四带三顺子
func HandOrderFourWithTwo ¶ added in v0.0.3
func HandOrderFourWithTwo[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
HandOrderFourWithTwo 四带二顺子
func HandOrderPairs ¶ added in v0.0.3
func HandOrderPairs[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
HandOrderPairs 对子顺子
func HandOrderSingle ¶ added in v0.0.3
func HandOrderSingle[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
HandOrderSingle 顺子
func HandOrderSingleFour ¶ added in v0.0.3
func HandOrderSingleFour[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
HandOrderSingleFour 四张顺子
func HandOrderSingleThree ¶ added in v0.0.3
func HandOrderSingleThree[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
HandOrderSingleThree 三张顺子
func HandOrderThreeWithOne ¶ added in v0.0.3
func HandOrderThreeWithOne[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
HandOrderThreeWithOne 三带一顺子
func HandOrderThreeWithTwo ¶ added in v0.0.3
func HandOrderThreeWithTwo[P, C generic.Number, T Card[P, C]](count int) HandHandle[P, C, T]
HandOrderThreeWithTwo 三带二顺子
func HandPairs ¶
func HandPairs[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandPairs 对子
func HandPlane ¶ added in v0.0.3
func HandPlane[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandPlane 飞机
- 表示三张点数相同的牌组成的连续的牌
func HandPlaneWithOne ¶ added in v0.0.3
func HandPlaneWithOne[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandPlaneWithOne 飞机带单
func HandRocket ¶ added in v0.0.3
func HandRocket[P, C generic.Number, T Card[P, C]](pile *CardPile[P, C, T]) HandHandle[P, C, T]
HandRocket 王炸
- 表示一对王牌,即大王和小王
func HandSingle ¶
func HandSingle[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandSingle 单牌
func HandStraightPairs ¶ added in v0.0.3
func HandStraightPairs[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandStraightPairs 连对
func HandThreeOfKind ¶
func HandThreeOfKind[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandThreeOfKind 三张
func HandThreeOfKindWithOne ¶ added in v0.0.3
func HandThreeOfKindWithOne[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandThreeOfKindWithOne 三带一
func HandThreeOfKindWithTwo ¶ added in v0.0.3
func HandThreeOfKindWithTwo[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandThreeOfKindWithTwo 三带二
func HandTwoWithOne ¶ added in v0.0.3
func HandTwoWithOne[P, C generic.Number, T Card[P, C]]() HandHandle[P, C, T]
HandTwoWithOne 二带一
- 表示两张点数相同的牌,加上一张其他点数的牌
- 例如:334、445、556、667、778、889、99J、TTQ、JJK、QQA、AA2
- 大小王不能用于二带一,因为他们没有点数
- 通常用于炸金花玩法中检查对子
type Option ¶
func WithColorSort ¶ added in v0.0.3
WithColorSort 通过特定的扑克花色顺序创建扑克玩法,顺序必须为连续的
func WithColorValue ¶
WithColorValue 通过特定的扑克花色牌值创建扑克玩法
func WithExcludeContinuityPoint ¶ added in v0.0.3
WithExcludeContinuityPoint 排除连续的点数
func WithHand ¶
func WithHand[P, C generic.Number, T Card[P, C]](pokerHand string, value int, handle HandHandle[P, C, T]) Option[P, C, T]
WithHand 通过绑定特定牌型的方式创建扑克玩法
- 牌型顺序决定了牌型的优先级
func WithHandRestraint ¶ added in v0.0.3
func WithHandRestraint[P, C generic.Number, T Card[P, C]](pokerHand, restraint string) Option[P, C, T]
WithHandRestraint 通过绑定特定克制牌型的方式创建扑克玩法
func WithHandRestraintFull ¶ added in v0.0.3
WithHandRestraintFull 通过绑定所有克制牌型的方式创建扑克玩法
- 需要确保在牌型声明之后调用
func WithPointSort ¶
WithPointSort 通过特定的扑克点数顺序创建扑克玩法,顺序必须为连续的
type Rule ¶ added in v0.0.3
func (*Rule[P, C, T]) CompareValueWithCards ¶ added in v0.0.3
func (slf *Rule[P, C, T]) CompareValueWithCards(cards1 []T, expression maths.CompareExpression, cards2 []T) bool
CompareValueWithCards 根据特定的条件表达式比较两组扑克牌的牌值
func (*Rule[P, C, T]) GetCardCount ¶ added in v0.0.4
GetCardCount 获取指定牌的数量
func (*Rule[P, C, T]) GetCardCountWithColor ¶ added in v0.0.4
GetCardCountWithColor 获取指定花色的牌的数量
func (*Rule[P, C, T]) GetCardCountWithColorMaximumNumber ¶ added in v0.0.4
func (slf *Rule[P, C, T]) GetCardCountWithColorMaximumNumber(cards []T, color C, maximumNumber int) int
GetCardCountWithColorMaximumNumber 获取指定花色的牌的数量
func (*Rule[P, C, T]) GetCardCountWithMaximumNumber ¶ added in v0.0.4
GetCardCountWithMaximumNumber 获取指定牌的数量
func (*Rule[P, C, T]) GetCardCountWithPoint ¶ added in v0.0.4
GetCardCountWithPoint 获取指定点数的牌的数量
func (*Rule[P, C, T]) GetCardCountWithPointMaximumNumber ¶ added in v0.0.4
func (slf *Rule[P, C, T]) GetCardCountWithPointMaximumNumber(cards []T, point P, maximumNumber int) int
GetCardCountWithPointMaximumNumber 获取指定点数的牌的数量
func (*Rule[P, C, T]) GetValueWithCards ¶ added in v0.0.3
GetValueWithCards 获取扑克牌的牌值
func (*Rule[P, C, T]) GetValueWithColor ¶ added in v0.0.3
GetValueWithColor 获取扑克牌的花色牌值
func (*Rule[P, C, T]) GetValueWithPoint ¶ added in v0.0.3
GetValueWithPoint 获取扑克牌的点数牌值
func (*Rule[P, C, T]) GetValueWithPokerHand ¶ added in v0.0.3
GetValueWithPokerHand 获取扑克牌的牌型牌值
func (*Rule[P, C, T]) IsPointContinuity ¶ added in v0.0.3
IsPointContinuity 检查一组扑克牌点数是否连续,count 表示了每个点数的数量
func (*Rule[P, C, T]) IsSameColor ¶ added in v0.0.3
IsSameColor 检查一组扑克牌是否同花
func (*Rule[P, C, T]) IsSamePoint ¶ added in v0.0.3
IsSamePoint 检查一组扑克牌是否同点
func (*Rule[P, C, T]) PokerHandIsMatch ¶ added in v0.0.3
PokerHandIsMatch 检查两组扑克牌牌型是否匹配
func (*Rule[P, C, T]) SortByColorAsc ¶ added in v0.0.3
func (slf *Rule[P, C, T]) SortByColorAsc(cards []T) []T
SortByColorAsc 将扑克牌按照花色从小到大排序
func (*Rule[P, C, T]) SortByColorDesc ¶ added in v0.0.3
func (slf *Rule[P, C, T]) SortByColorDesc(cards []T) []T
SortByColorDesc 将扑克牌按照花色从大到小排序
func (*Rule[P, C, T]) SortByPointAsc ¶ added in v0.0.3
func (slf *Rule[P, C, T]) SortByPointAsc(cards []T) []T
SortByPointAsc 将扑克牌按照点数从小到大排序
func (*Rule[P, C, T]) SortByPointDesc ¶ added in v0.0.3
func (slf *Rule[P, C, T]) SortByPointDesc(cards []T) []T
SortByPointDesc 将扑克牌按照点数从大到小排序