Documentation
¶
Index ¶
Constants ¶
View Source
const EndedPlayerId int = -2
View Source
const ErrorPlayerId int = -3
View Source
const NotStartedPlayerId int = -1
Variables ¶
View Source
var StandardDeck []Card = newStandardDeck()
Functions ¶
func NumericCompare ¶
Compares cards by their ranks and suits directly without game specific rules.
Types ¶
type CardComparator ¶
var BasicComparator CardComparator = CardComparatorImpl{ // contains filtered or unexported fields }
type CardComparatorImpl ¶
type CardComparatorImpl struct {
// contains filtered or unexported fields
}
func (CardComparatorImpl) Compare ¶
func (comparator CardComparatorImpl) Compare(a, b Card) int
CardComparatorImpl implements the CardComparator interface. It uses a function to compare two cards and can chain to another comparator. If the compareFunc returns _terminate, it stops the comparison and returns the result. If it returns _continue, it passes the comparison to the next comparator in the chain.
type CardCompare ¶
type Game ¶
type Game struct {
DrawPile *Deck
InPlayPile *Deck
DiscardPile *Deck
Hands []Hand
// contains filtered or unexported fields
}
func (*Game) CurrentHand ¶
func (*Game) PlayHand ¶
func (game *Game) PlayHand(play Play) PlayResult
Click to show internal directories.
Click to hide internal directories.