whist.core.deck¶
Collections of cards
Module Contents¶
Classes¶
An unordered collection of cards |
- class whist.core.deck.Deck(*args: tuple[Iterable[whist.core.card.Card]], tuple[whist.core.card.Card, Ellipsis])¶
An unordered collection of cards
- __cards :set[whist.core.card.Card]¶
- add(self, card: whist.core.card.Card) → None¶
Add a card to this deck.
- Parameters
card – card to add
- remove(self, card: whist.core.card.Card) → None¶
Remove a card from this deck.
- Parameters
card – card to remove
- __contains__(self, card: whist.core.card.Card) → bool¶
- __len__(self)¶
- __iter__(self) → Iterator[whist.core.card.Card]¶
- __str__(self) → str¶
Return str(self).
- __repr__(self) → str¶
Return repr(self).
- __eq__(self, other: Any) → bool¶
Return self==value.
- __ne__(self, other: Any) → bool¶
Return self!=value.
- __hash__(self) → int¶
Return hash(self).
- static empty()¶
Create an empty deck.
- Returns
empty deck
- static full()¶
Create a full deck.
- Returns
full deck