Deck
from dgisim import Deck, MutableDeck, FrozenDeck
A data structure for a deck. A deck contains a sequence of characters and a dictionary of cards.
- class Deck
An abstract class representing a deck of cards.
- abstract classmethod decoding(encoding: list[int], encoding_plan: EncodingPlan) None | Self
- Returns:
A deck parsed from the given list of integers.
- encoding(encoding_plan: EncodingPlan) list[int]
- Returns:
A list of integers representing the deck.
- abstract classmethod from_json(data: str) None | Self
- Returns:
A deck parsed from the given JSON string.
- to_frozen() FrozenDeck
- Returns:
An immutable copy of the deck.
- to_mutable() MutableDeck
- Returns:
A mutable copy of the deck.
- class MutableDeck(chars: 'list[type[Character]]', cards: 'dict[type[Card], int]')
Bases:
Deck- classmethod decoding(encoding: list[int], encoding_plan: EncodingPlan) None | Self
- Returns:
A deck parsed from the given list of integers.