Deck
Warning
scooze decks are still under construction...
scooze.deck
¶
Deck
¶
Bases: ComparableObject
A class to represent a deck of Magic: the Gathering cards.
Attributes:
| Name | Type | Description |
|---|---|---|
archetype |
str | None
|
The archetype of this Deck. |
format |
Format
|
The format legality of the cards in this Deck. |
main |
CardList
|
The main deck. Typically 60 cards minimum. |
side |
CardList
|
The sideboard. Typically 15 cards maximum. |
cmdr |
CardList
|
The command zone. Typically 1 or 2 cards in Commander formats. |
attractions |
CardList
|
The attraction deck. |
stickers |
CardList
|
The sticker deck. |
companion |
Card | None
|
This deck's companion (if applicable). |
cards: Counter[Card]
property
¶
Get this Deck as a collection of cards.
average_cmc() -> float
¶
The average mana value of cards in this Deck.
average_words() -> float
¶
The average number of words across all oracle text on all cards in this Deck (excludes reminder text).
total_cards() -> int
¶
The number of cards in this Deck.
total_cmc() -> float
¶
The total mana value of cards in this Deck.
count_pips() -> Counter[CostSymbol]
¶
A mapping of Colors to how many times they appear as mana symbols in costs of cards in this Deck.
total_words() -> int
¶
The number of words across all oracle text on all cards in this Deck (excludes reminder text).
diff(other: Self) -> DeckDiff
¶
decklist_equals(other: Self) -> bool
¶
export(export_format: DecklistFormatter = None) -> str
¶
Export this Deck as a string with the given DecklistFormatter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
export_format |
DecklistFormatter
|
The format of the exported Deck. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
A string containing the names and quantities of the cards in this Deck. |
is_legal(format: Format = None) -> bool
¶
Determine if this Deck is legal in the given format.
Default checks against self.Format. If self.Format is unset, checks
against Format.NONE.
- For cards with
Legality.RESTRICTED, only 1 or fewer may be present throughout all deck parts. - For cards with
Legality.LEGAL, only N or fewer may be present throughout all deck parts where N is determined by the max quantity of a single cards allowed by the given format. - For cards with
Legality.BANNEDorLegality.NOT_LEGAL, none may be present throughout all deck parts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
format |
Format
|
The format to check against. |
None
|
add_card(card: Card, quantity: int = 1, in_the: InThe = InThe.MAIN) -> None
¶
add_cards(cards: Counter[Card], in_the: InThe = InThe.MAIN) -> None
¶
remove_card(card: Card, quantity: int = maxsize, in_the: InThe = InThe.MAIN) -> None
¶
Remove a given quantity of a given card from this Deck. If quantity is not provided, removes all copies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
card |
Card
|
The card to remove. |
required |
quantity |
int
|
The number of copies of the card to be removed. |
maxsize
|
in_the |
InThe
|
Where to remove the cards from (main, side, etc.) |
MAIN
|
DeckDiff
¶
Bases: ComparableObject
A class to represent a diff between two decks.
Attributes:
| Name | Type | Description |
|---|---|---|
main |
DictDiff
|
The diff between the main decks of two Decks. |
side |
DictDiff
|
The diff between the sideboards of two Decks. |
cmdr |
DictDiff
|
The diff between the command zones of two Decks. |
attractions |
DictDiff
|
The diff between the attractions of the two Decks. |
stickers |
DictDiff
|
The diff between the stickers of the two Decks. |
total() -> int
¶
The number of cards in this DeckDiff.
DecklistFormatter
¶
InThe
¶
scooze.cardlist
¶
CardList
¶
Bases: ComparableObject
A class to represent a list of cards, generally as a part of a deck.
Attributes:
| Name | Type | Description |
|---|---|---|
cards |
Counter[Card]
|
The cards in this CardList. |
total() -> int
¶
The number of cards in this CardList.
count_pips() -> Counter[CostSymbol]
¶
A mapping of Colors to how many times they appear as mana symbols in costs of cards in this CardList.