Beispiel #1
0
func holeCardsPopMulti(d *hand.Deck, v CardVisibility, n int) []*HoleCard {
	cards := d.PopMulti(n)
	holeCards := []*HoleCard{}
	for _, c := range cards {
		holeCards = append(holeCards, newHoleCard(c, v))
	}
	return holeCards
}
Beispiel #2
0
func (g *studGame) HoleCards(deck *hand.Deck, r round) []*HoleCard {
	switch r {
	case thirdSt:
		cards := holeCardsPopMulti(deck, Concealed, 2)
		cards = append(cards, newHoleCard(deck.Pop(), Exposed))
		return cards
	case fourthSt:
		return holeCardsPopMulti(deck, Exposed, 1)
	case fifthSt:
		return holeCardsPopMulti(deck, Exposed, 1)
	case sixthSt:
		return holeCardsPopMulti(deck, Exposed, 1)
	case seventhSt:
		return holeCardsPopMulti(deck, Concealed, 1)
	}
	return []*HoleCard{}
}
Beispiel #3
0
func (g *holdemGame) BoardCards(deck *hand.Deck, r round) []*hand.Card {
	switch r {
	case flop:
		return deck.PopMulti(3)
	case turn:
		return deck.PopMulti(1)
	case river:
		return deck.PopMulti(1)
	}
	return []*hand.Card{}
}