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 }
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{} }
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{} }