Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CardRankNames = []string{
"One",
"Two",
"Three",
"Four",
"Five",
"Six",
"Seven",
"Eight",
"Nine",
"Ten",
"Jack",
"Queen",
"King",
"Ace",
}
CardRankNames is a list of suit names
var CardRanks = []CardRank{ One, Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King, Ace, }
CardRanks is a list of available suits
var CardSuitNames = []string{
"Heart",
"Diamond",
"Club",
"Spade",
}
CardSuitNames is a list of suit names
CardSuits is a list of available suits
var GameTypeNames = []string{
"Cash",
"Tournament",
}
LimitNames is a list of limit names
var GameTypes = []GameType{ Cash, Tournament, }
GameTypes is a list of all available game types
var LimitNames = []string{
"No limit",
"Pot limit",
"Fixed limit",
}
LimitNames is a list of limit names
var Limits = []Limit{ NoLimit, PotLimit, FixedLimit, }
Limits is a list of all available limits
Functions ¶
This section is empty.
Types ¶
type CardRank ¶
type CardRank int
CardRank represents the card rank such as (one, two, three, four, five, six, seven, eight, nine, ten, jack, queen, king, ace, joker)
type CardSuit ¶
type CardSuit int
CardSuit represents the card suit such as heart, dimaond, club and spade
type Deck ¶
type Deck []Card
Deck represents a deck of cards with basic shuffle and pull functionality
type Event ¶
type Event struct {
TableEvent *TableEvent
}
type Game ¶
type Game struct { Type GameType Rules Rules Limit Limit // Break Related NextBreak time.Time BreakInterval time.Duration // Mandatory Structure Related NextLevel time.Time CurrentLevel uint LevelInterval time.Duration MandatoryStructure []MandatoryStructure }
Game represents a poker game (also tournaments)
type MandatoryStructure ¶
MandatoryStructure ...
type Player ¶
type Player struct { AccountID int Chips float64 Nickname string Avatar string Connected bool Inactive bool LastAction time.Time }
Player represents a player at a table
type PlayerStatus ¶
type PlayerStatus int
PlayerStatus represents the players current table status
const ( EnteringNextHand PlayerStatus = -3 EnteringNextBigBlind PlayerStatus = -2 SittingOut PlayerStatus = -1 Empty PlayerStatus = iota BuyIn Playing Folded )
type Randomizer ¶
type Randomizer interface { // Shuffle pseudo-randomizes the order of elements using the default Source. // n is the number of elements. Shuffle panics if n < 0. // swap swaps the elements with indexes i and j. Shuffle(n int, swap func(i, j int)) }
Randomizer is used by a deck to randomize outcomes of shuffles
type Rules ¶
type Rules interface { // Stage perfoms the provided stage, adjusts accordingly and then returns the changed table state and the next stage Stage(table Table, stage Stage) (outcome Table, nextStage Stage) // Win checks if slot1 beats slot2 with provided community cards // returns 0 if it's a tie, 1 if slot1 wins, 2 if slot2 wins Win(player1 []Card, player2 []Card, community []Card) int }
Rules implements the funcs used by Game to determine outcome
type Slot ¶
type Slot struct { Player Player Cards []Card Status PlayerStatus SittingOutSince time.Time }
Slot represents a table slot
type TableEvent ¶
TableEvent describes a state change on a table
type TableEventType ¶
type TableEventType int
TableEventType type of table event
const ( UnknownTableEventType TableEventType = iota DeniedEntrance )