DeckMessageBuilder
extends MessageBuilder
in package
A preconstructed deck as a Components V2 message: its commander, the main board grouped by card type with counts, the sideboard, a picker to look at a card, and an Export button for a decklist that MTG Arena and most deck sites import.
Custom ids (Decks module): deck:export:<fileName> and deck:card (the
picker, valued with a uuid).
Tags
Table of Contents
Constants
- ACCENT : int = 0x3c8d93
- The accent color of deck messages.
- GROUPS : array<string|int, string> = ['Creature', 'Planeswalker', 'Battle', 'Instant...
- Card types in the order a decklist groups them; a card goes under the first it has.
- PREFIX : string = 'deck'
- The custom id prefix of deck components.
Methods
- count() : int
- Copies of cards, counting each entry's `count`.
- deck() : static
- The deck view.
- export() : string
- The decklist as text, in the `count Name (SET) number` form MTG Arena and most deck sites import.
- groups() : array<string, array<string|int, Card>>
- Cards grouped by their first type in {@see GROUPS} order.
- line() : string
- A deck as one line of a list.
Constants
ACCENT
The accent color of deck messages.
public
int
ACCENT
= 0x3c8d93
GROUPS
Card types in the order a decklist groups them; a card goes under the first it has.
public
array<string|int, string>
GROUPS
= ['Creature', 'Planeswalker', 'Battle', 'Instant', 'Sorcery', 'Artifact', 'Enchantment', 'Land']
PREFIX
The custom id prefix of deck components.
public
string
PREFIX
= 'deck'
Methods
count()
Copies of cards, counting each entry's `count`.
public
static count(array<string|int, Card> $cards) : int
Parameters
- $cards : array<string|int, Card>
Return values
intdeck()
The deck view.
public
static deck(Deck $deck) : static
Parameters
- $deck : Deck
-
A deck with its cards.
Return values
staticexport()
The decklist as text, in the `count Name (SET) number` form MTG Arena and most deck sites import.
public
static export(Deck $deck) : string
Parameters
- $deck : Deck
Return values
stringgroups()
Cards grouped by their first type in {@see GROUPS} order.
public
static groups(array<string|int, Card> $cards) : array<string, array<string|int, Card>>
Parameters
- $cards : array<string|int, Card>
Return values
array<string, array<string|int, Card>>line()
A deck as one line of a list.
public
static line(Deck $deck) : string
Parameters
- $deck : Deck
-
A Deck List entry.