Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / FormatEventCommand

Type Alias: FormatEventCommand ​

FormatEventCommand = { deck: DeckInput; type: "sideboard"; } | { ready?: boolean; type: "readyNextGame"; } | { deckIndex: number; type: "banTrilogyDeck"; } | { deckIndex: number; type: "selectTrilogyDeck"; } | { cardId: number; packIndex: number; type: "draftPick"; } | { bestOfGames: number; type: "extendSeries"; } | { accept: boolean; type: "respondSeriesExtension"; } | { type: "requestRematch"; } | { accept: boolean; type: "respondRematch"; }

Defined in: packages/ts-sdk/src/generated/types/common.ts:1598

Out-of-game command for format and event workflows.

Example:

ts
import type { FormatEventCommand } from '@my-swu/simulator-client'

const readyNextGameCommand = { type: 'readyNextGame' } satisfies FormatEventCommand

console.log(readyNextGameCommand)

Union Members ​

Type Literal ​

Example:

ts
import type { FormatEventCommand } from '@my-swu/simulator-client'

// Use card ids; the server validates deck legality.
const premierHostDeck = {
  leader: 46102, // Leia Organa - Someone Who Loves You
  leaders: [], // Twin Suns only; Premier uses the single `leader` above.
  base: 308, // Echo Base
  cards: Array.from({ length: 50 }, () => 45), // Alliance X-Wing
  sideboard: [],
}

const sideboardCommand = { type: 'sideboard', deck: premierHostDeck } satisfies FormatEventCommand

console.log(sideboardCommand.deck.cards.length)

{ deck: DeckInput; type: "sideboard"; }

deck ​

deck: DeckInput

Full main-deck plus sideboard list after sideboarding.

Limited formats keep this sideboard empty and validate unused cards against their registered pool instead.

type ​

type: "sideboard"


Type Literal ​

Example:

ts
import type { FormatEventCommand } from '@my-swu/simulator-client'

const readyNextGameCommand = { type: 'readyNextGame' } satisfies FormatEventCommand

console.log(readyNextGameCommand.type)

{ ready?: boolean; type: "readyNextGame"; }


Type Literal ​

Example:

ts
import type { FormatEventCommand } from '@my-swu/simulator-client'

const banTrilogyDeckCommand = { type: 'banTrilogyDeck', deckIndex: 0 } satisfies FormatEventCommand

console.log(banTrilogyDeckCommand.deckIndex)

{ deckIndex: number; type: "banTrilogyDeck"; }

deckIndex ​

deckIndex: number

Zero-based index into the opponent's registered deck set.

type ​

type: "banTrilogyDeck"


Type Literal ​

Example:

ts
import type { FormatEventCommand } from '@my-swu/simulator-client'

const selectTrilogyDeckCommand = { type: 'selectTrilogyDeck', deckIndex: 1 } satisfies FormatEventCommand

console.log(selectTrilogyDeckCommand.deckIndex)

{ deckIndex: number; type: "selectTrilogyDeck"; }

deckIndex ​

deckIndex: number

Zero-based index into this seat's registered deck set.

type ​

type: "selectTrilogyDeck"


Type Literal ​

Example:

ts
import type { FormatEventCommand } from '@my-swu/simulator-client'

const draftPickCommand = {
  type: 'draftPick',
  packIndex: 0,
  cardId: 45, // Alliance X-Wing card id
} satisfies FormatEventCommand

console.log(draftPickCommand.cardId)

{ cardId: number; packIndex: number; type: "draftPick"; }

cardId ​

cardId: number

Card id to pick from the selected pack.

packIndex ​

packIndex: number

Zero-based index into this seat's active draft packs.

type ​

type: "draftPick"


Type Literal ​

Example:

ts
import type { FormatEventCommand } from '@my-swu/simulator-client'

const readyNextGameCommand = { type: 'readyNextGame' } satisfies FormatEventCommand

console.log(readyNextGameCommand)

{ bestOfGames: number; type: "extendSeries"; }

bestOfGames ​

bestOfGames: number

Best-of size to convert to. Only three is supported.

type ​

type: "extendSeries"


Type Literal ​

Example:

ts
import type { FormatEventCommand } from '@my-swu/simulator-client'

const readyNextGameCommand = { type: 'readyNextGame' } satisfies FormatEventCommand

console.log(readyNextGameCommand)

{ accept: boolean; type: "respondSeriesExtension"; }

accept ​

accept: boolean

Whether this seat wants the extended series.

type ​

type: "respondSeriesExtension"


Type Literal ​

Example:

ts
import type { FormatEventCommand } from '@my-swu/simulator-client'

const readyNextGameCommand = { type: 'readyNextGame' } satisfies FormatEventCommand

console.log(readyNextGameCommand)

{ type: "requestRematch"; }


Type Literal ​

Example:

ts
import type { FormatEventCommand } from '@my-swu/simulator-client'

const readyNextGameCommand = { type: 'readyNextGame' } satisfies FormatEventCommand

console.log(readyNextGameCommand)

{ accept: boolean; type: "respondRematch"; }

accept ​

accept: boolean

Whether this seat wants the rematch.

type ​

type: "respondRematch"

Released under the MIT License.