whist_core.cards.card¶
Card related classes
Module Contents¶
Classes¶
Generic enumeration. |
|
Suits in a playing card deck |
|
Ranks in a playing card deck |
|
A playing card |
- class whist_core.cards.card._CardEnum(_: str, short_name: str | None = None)¶
Bases:
enum.EnumGeneric enumeration.
Derive from this class to define new enumerations.
- property ordinal: int¶
Get the ordinal.
- Returns:
ordinal
- property long_name: str¶
Get the long version of the name.
- Returns:
long version of name
- property short_name: str¶
Get the short version of the name.
- Returns:
short version of name
- __lt__(other: Any) bool¶
Return self<value.
- __str__() str¶
Return str(self).
- class whist_core.cards.card.Suit(_: str, short_name: str | None = None)¶
Bases:
_CardEnumSuits in a playing card deck
- CLUBS = ('clubs', '♣')¶
- DIAMONDS = ('diamonds', '♦')¶
- HEARTS = ('hearts', '♥')¶
- SPADES = ('spades', '♠')¶
- class whist_core.cards.card.Rank(_: str, short_name: str | None = None)¶
Bases:
_CardEnumRanks in a playing card deck
- NUM_2 = '2'¶
- NUM_3 = '3'¶
- NUM_4 = '4'¶
- NUM_5 = '5'¶
- NUM_6 = '6'¶
- NUM_7 = '7'¶
- NUM_8 = '8'¶
- NUM_9 = '9'¶
- NUM_10 = '10'¶
- J = ('jack', 'J')¶
- Q = ('queen', 'Q')¶
- K = ('king', 'K')¶
- A = ('ace', 'A')¶
- class whist_core.cards.card.Card¶
Bases:
pydantic.BaseModelA playing card
- property short_name: str¶
Get the short name of this card.
- Returns:
short name
- property name: str¶
Get the name of this card.
- Returns:
name
- dict(*args, **kwargs)¶
Returns the dictionary. See BaseModel for details.
- model_dump(*args, **kwargs)¶
Returns the dictionary. See BaseModel for details.
- __lt__(other: Any) bool¶
Checks if the other card is lower than this card.
- __str__() str¶
Returns string representation of this card.