Skip to content

Deck

A Deck is the list a player brings to a game. The engine reads the parts it needs to build the game — cards, sideboard, commanders, and the supplementary decks (attractions, contraptions, schemes, planes) — and round-trips the rest unchanged: the remaining fields are client-side state (stack positions, tags, cover art) the engine doesn’t model but preserves so the wire shape stays identical.

Each block below is generated from the same source as the engine bindings (ts-rs for TypeScript, the manabrew-protocol crate for Rust).

The whole deck — its identity, the maindeck and sideboard, the supplementary zones, and the preserved client-side metadata.

interface Deck {
id?: string;
name: string;
description?: string;
color?: string;
format?: DeckFormat;
cards: Array<DeckCard>;
sideboard: Array<DeckCard>;
attractions?: Array<DeckCard>;
contraptions?: Array<DeckCard>;
schemes?: Array<DeckCard>;
planes?: Array<DeckCard>;
commanders?: Array<DeckCard>;
companion?: DeckCard;
maybeboard?: Array<DeckCard>;
draft?: boolean;
labels?: Array<DeckLabel>;
coverCardName?: string;
coverCardFace?: number;
playmat?: string;
playmatSettings?: PlaymatSettings;
stackPositions?: Record<string, { x: number; y: number }>;
tokens?: Array<DeckCard>;
}

References: DeckCard , DeckFormat , DeckLabel , PlaymatSettings

One entry in a deck. Identity (id, name, setCode, cardNumber, foil) and a rules summary are flattened in alongside the UI-only uris, so a DeckCard is a single flat object on the wire.

interface DeckCard {
uris: CardImageUris;
allParts?: Array<CardPart>;
id: string;
name: string;
setCode: string;
cardNumber: string;
foil?: boolean;
color: string;
colorIdentity: Array<string>;
manaCost: string;
cmc: number;
types: Array<string>;
subtypes: Array<string>;
supertypes: Array<string>;
keywords?: Array<string>;
power?: string;
toughness?: string;
text: string;
layout?: string;
isDoubleFaced?: boolean;
}

References: CardImageUris , CardPart

A user-defined label attached to a deck.

interface DeckLabel {
name: string;
color?: string;
}