Skip to content

The game view

A StateUpdate carries one field, gameView — a complete GameViewDto snapshot of the game. It is the only carrier of authoritative game state: the client throws away its previous view and re-renders the board from each one.

The whole-game snapshot: turn structure, both players, the battlefield, the stack, and game-end state.

interface GameViewDto {
gameId: string;
turn: number;
step: string;
combatAssignments: Array<CombatAssignmentDto>;
activePlayerId: string;
priorityPlayerId: string;
players: Array<PlayerDto>;
battlefield: Array<CardDto>;
stack: Array<StackObjectDto>;
gameOver: boolean;
winnerId: string | null;
concededPlayerIds: Array<string>;
monarchId: string | null;
initiativeHolderId: string | null;
}

References: CardDto , CombatAssignmentDto , PlayerDto , StackObjectDto

One player’s public and private state — life, counters, and the cards in each of their zones.

interface PlayerDto {
id: string;
name: string;
isHuman: boolean;
life: number;
poison: number;
hand: Array<CardDto>;
graveyard: Array<CardDto>;
exile: Array<CardDto>;
commandZone: Array<CardDto>;
libraryCount: number;
manaPool: Record<string, number>;
commanderDamage: Record<string, number>;
energyCounters: number;
radiationCounters: number;
hasCityBlessing: boolean;
ringLevel: number;
speed: number;
}

References: CardDto

The engine’s snapshot of a single card — every zone holds these. Only id and name are needed to round-trip a choice; the rest drives richer rendering. The prompt pages that show cards reference this same type.

interface CardDto {
id: string;
name: string;
setCode: string;
cardNumber: string;
color: string;
manaCost: string;
cmc: number;
types: Array<string>;
subtypes: Array<string>;
supertypes: Array<string>;
power: string | null;
toughness: string | null;
basePower?: number;
baseToughness?: number;
text: string;
controllerId: string;
ownerId: string;
zoneId: string;
tapped: boolean;
isCrewed: boolean;
isAttacking: boolean;
attackingPlayerId?: string;
keywords: Array<string>;
counters: Record<string, number>;
damage: number;
summoningSick: boolean;
isToken: boolean;
isCopy: boolean;
isDoubleFaced: boolean;
isTransformed: boolean;
isFaceDown: boolean;
isBestowed: boolean;
phasedOut: boolean;
exerted: boolean;
isRingBearer: boolean;
attachedTo?: string;
attachmentIds: Array<string>;
flashbackCost?: string;
kickerCost?: string;
effectiveManaCost?: string;
madnessCost?: string;
isMadnessExiled: boolean;
isPlotted: boolean;
isWarpExiled: boolean;
foil: boolean;
wouldDieInCombat: boolean;
}

A declared block: which blocker is assigned to which attacker.

interface CombatAssignmentDto {
blockerId: string;
attackerId: string;
}

A spell or ability currently on the stack, with its targets.

interface StackObjectDto {
id: string;
sourceId: string;
controllerId: string;
name: string;
text: string;
setCode: string;
cardNumber: string;
isPermanentSpell: boolean;
isCasting: boolean;
targets: Array<StackTargetDto>;
}

References: StackTargetDto

One target chosen by a StackObjectDto, tagged with the TargetingIntent the engine inferred for it.

interface StackTargetDto {
kind: StackTargetKindDto;
id: string;
nodeIndex: number;
targetIndex: number;
hostile: boolean;
intent: TargetingIntent;
}

References: StackTargetKindDto , TargetingIntent

Which id space a StackTargetDto points into — a card, a player, or another object on the stack.

type StackTargetKindDto = "card" | "player" | "stack";

A semantic hint describing what an effect intends to do to its target — the client uses it to pre-highlight sensible targets. Carried by StackTargetDto and by the targeting prompts.

type TargetingIntent =
| "damage"
| "destroy"
| "sacrifice"
| "exile"
| "bounce"
| "mill"
| "discard"
| "counter"
| "tap"
| "untap"
| "copy"
| "buff"
| "debuff"
| "heal"
| "loseLife"
| "reveal"
| "draw"
| "gainControl"
| "fight"
| "attach"
| "attack"
| "block"
| "hostile"
| "friendly";