예제 #1
0
파일: hole_card.go 프로젝트: notnil/joker
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
}
예제 #2
0
파일: game.go 프로젝트: notnil/joker
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{}
}
예제 #3
0
파일: game.go 프로젝트: notnil/joker
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{}
}