Esempio n. 1
0
    def combinations(self, n):
	"""Generator function return all combinations of n cards (including
	community cards)."""
	assertInstance(n, int)
	cards = Cards(self)
	if self.board:
	    cards.extend(self.board)
	return Cards.combinations(cards, n)
Esempio n. 2
0
    def hands(self):
	"""Return all sets of cards that can be constructed from hand."""
	cards = Cards(self)
	if self.board:
	    cards.extend(self.board)
	yield cards
Esempio n. 3
0
    def extend(self, cards):
	"""Extend while checking to be sure maxCards is not exceeded."""
	if self.maxCards:
	    if len(self) + len(cards) > self.maxCards:
		raise TooManyCardsException()
	Cards.extend(self, cards)
Esempio n. 4
0
    def getHoleCards(self):
	"""Return the hole (non-community) cards."""
	c = Cards()
	c.extend(self)
	return c