@my-swu/simulator-client / GameState
Interface: GameState
Defined in: packages/ts-sdk/src/generated/types/common.ts:2414
Complete public projection of one match.
Besides riding the wire, this type is embedded in persisted lobby and tournament records (per-player startedAccess.access.snapshot), so rows in storage keep whatever shape they were stored with. A field added without #[serde(default)] makes every older stored record fail strict decode; either keep the default or extend the restoration tables in swu-server/src/legacy_snapshots.rs in the same change.
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
console.log(matchSnapshot)Properties
actionAbilities
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { actionAbilities } = matchSnapshot
console.log(actionAbilities)actionAbilities:
ActionAbilityView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2415
activeEffects
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { activeEffects } = matchSnapshot
console.log(activeEffects)activeEffects:
ActiveEffectView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2419
Engine-authoritative outstanding public effects that are active now.
activePlayer?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { activePlayer } = matchSnapshot
console.log(activePlayer)
optionalactivePlayer?:Seat|null
Defined in: packages/ts-sdk/src/generated/types/common.ts:2420
availableAttacks
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { availableAttacks } = matchSnapshot
console.log(availableAttacks)availableAttacks:
AvailableAttackView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2421
availableCounters
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { availableCounters } = matchSnapshot
console.log(availableCounters)availableCounters:
TwinSunsCounter[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2422
availableLeaderDeploys
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { availableLeaderDeploys } = matchSnapshot
console.log(availableLeaderDeploys)availableLeaderDeploys:
LeaderDeployActionView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2423
consecutivePasses
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { consecutivePasses } = matchSnapshot
console.log(consecutivePasses)consecutivePasses:
number
Defined in: packages/ts-sdk/src/generated/types/common.ts:2424
currentAttack
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { currentAttack } = matchSnapshot
console.log(currentAttack)currentAttack:
CurrentAttackStateView
Defined in: packages/ts-sdk/src/generated/types/common.ts:2425
delayedEffects
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { delayedEffects } = matchSnapshot
console.log(delayedEffects)delayedEffects:
DelayedEffectView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2429
Engine-authoritative outstanding public effects waiting on later timing.
effectResolutionDraft?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { effectResolutionDraft } = matchSnapshot
console.log(effectResolutionDraft)
optionaleffectResolutionDraft?:EffectResolutionDraftView|null
Defined in: packages/ts-sdk/src/generated/types/common.ts:2433
Viewer-owned effect inputs awaiting atomic commit.
eventsApplied
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { eventsApplied } = matchSnapshot
console.log(eventsApplied)eventsApplied:
number
Defined in: packages/ts-sdk/src/generated/types/common.ts:2434
format
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { format } = matchSnapshot
console.log(format)format:
MatchFormat
Defined in: packages/ts-sdk/src/generated/types/common.ts:2438
Match format requested at creation time.
gameTimer?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { gameTimer } = matchSnapshot
console.log(gameTimer)
optionalgameTimer?:GameTimerStateView|null
Defined in: packages/ts-sdk/src/generated/types/common.ts:2439
groundArena
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { groundArena } = matchSnapshot
console.log(groundArena)groundArena:
UnitStateView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2440
initiative
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { initiative } = matchSnapshot
console.log(initiative)initiative:
InitiativeState
Defined in: packages/ts-sdk/src/generated/types/common.ts:2441
leaderAction?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { leaderAction } = matchSnapshot
console.log(leaderAction)
optionalleaderAction?:LeaderActionView|null
Defined in: packages/ts-sdk/src/generated/types/common.ts:2442
matchId
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { matchId } = matchSnapshot
console.log(matchId)matchId:
string
Defined in: packages/ts-sdk/src/generated/types/common.ts:2443
pendingAbilities
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { pendingAbilities } = matchSnapshot
console.log(pendingAbilities)pendingAbilities:
PendingAbilityView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2453
Abilities awaiting input, in presentation order only.
Index 0 has no semantic meaning: it is whichever ability the engine collected first in the current simultaneous batch. Clients that need a specific ability must match on its identity (id / sourceCardId / sourceUnitId / window / clauseId / family), never on position.
pendingChoice?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { pendingChoice } = matchSnapshot
console.log(pendingChoice)
optionalpendingChoice?:PendingChoiceView|null
Defined in: packages/ts-sdk/src/generated/types/common.ts:2457
The one prompt payload the viewer is being asked for, if any.
pendingUndo?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { pendingUndo } = matchSnapshot
console.log(pendingUndo)
optionalpendingUndo?:PendingUndoRequest|null
Defined in: packages/ts-sdk/src/generated/types/common.ts:2463
Sensitive multiplayer undo waiting for approval from the other human seats. Fully public: every viewer (including spectators) sees the same request, only the prompt actions differ per seat client-side.
phase
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { phase } = matchSnapshot
console.log(phase)phase:
MatchPhase
Defined in: packages/ts-sdk/src/generated/types/common.ts:2464
playActions
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { playActions } = matchSnapshot
console.log(playActions)playActions:
PlayActionView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2465
playerCount
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { playerCount } = matchSnapshot
console.log(playerCount)playerCount:
number
Defined in: packages/ts-sdk/src/generated/types/common.ts:2469
Configured number of seats in clockwise order.
players
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { players } = matchSnapshot
console.log(players)players:
SeatState[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2470
playground?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { playground } = matchSnapshot
console.log(playground)
optionalplayground?:boolean
Defined in: packages/ts-sdk/src/generated/types/common.ts:2474
Whether this snapshot belongs to a server-authorized Playground match.
playgroundActionAbilities?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { playgroundActionAbilities } = matchSnapshot
console.log(playgroundActionAbilities)
optionalplaygroundActionAbilities?:PlaygroundActionAbilityView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2479
Host-only Playground ability projection. Empty for normal matches and while a resolution owns the command boundary.
playgroundDeckCardIds?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { playgroundDeckCardIds } = matchSnapshot
console.log(playgroundDeckCardIds)
optionalplaygroundDeckCardIds?:number[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2483
Printed cards supplied by every configured Playground deck.
prompt
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { prompt } = matchSnapshot
console.log(prompt)prompt:
PromptState
Defined in: packages/ts-sdk/src/generated/types/common.ts:2484
rejectedPlayReasons
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { rejectedPlayReasons } = matchSnapshot
console.log(rejectedPlayReasons)rejectedPlayReasons:
RejectedPlayView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2485
result?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { result } = matchSnapshot
console.log(result)
optionalresult?:MatchResult|null
Defined in: packages/ts-sdk/src/generated/types/common.ts:2486
roundNumber
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { roundNumber } = matchSnapshot
console.log(roundNumber)roundNumber:
number
Defined in: packages/ts-sdk/src/generated/types/common.ts:2487
series
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { series } = matchSnapshot
console.log(series)series:
MatchSeriesView
Defined in: packages/ts-sdk/src/generated/types/common.ts:2491
Multi-game and format-event state for this match.
spaceArena
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { spaceArena } = matchSnapshot
console.log(spaceArena)spaceArena:
UnitStateView[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2492
status
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { status: healthStatus } = matchSnapshot
console.log(healthStatus)status:
MatchStatus
Defined in: packages/ts-sdk/src/generated/types/common.ts:2493
trilogyFormat?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { trilogyFormat } = matchSnapshot
console.log(trilogyFormat)
optionaltrilogyFormat?:ConstructedFormat|null
Defined in: packages/ts-sdk/src/generated/types/common.ts:2497
Constructed legality profile selected for Trilogy deck validation.
turnPlayer
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { turnPlayer } = matchSnapshot
console.log(turnPlayer)turnPlayer:
NullableSeatView
Defined in: packages/ts-sdk/src/generated/types/common.ts:2507
The seat whose action-phase turn is currently in progress.
Use this — not active_player — to answer "whose turn is it". The engine reassigns active_player to whoever must resolve a forced prompt (e.g. the opponent distributing indirect damage from your card), but the turn itself stays with the player who began it. None outside the action phase (lobby / setup / regroup / once the match is decided).
twinSunsCounters?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { twinSunsCounters } = matchSnapshot
console.log(twinSunsCounters)
optionaltwinSunsCounters?:TwinSunsCountersView|null
Defined in: packages/ts-sdk/src/generated/types/common.ts:2508
undoDeclinedRequesters?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { undoDeclinedRequesters } = matchSnapshot
console.log(undoDeclinedRequesters)
optionalundoDeclinedRequesters?:Seat[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2514
Seats whose undo request was declined during the current turn; those seats cannot request an undo again until the next turn begins. Fully public like the pending request itself.
winner?
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { winner } = matchSnapshot
console.log(winner)
optionalwinner?:Seat|null
Defined in: packages/ts-sdk/src/generated/types/common.ts:2515
winners
Example:
import { createSimulatorClient } from '@my-swu/simulator-client'
// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
baseUrl: 'http://127.0.0.1:4000',
})
// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')
const { winners } = matchSnapshot
console.log(winners)winners:
Seat[]
Defined in: packages/ts-sdk/src/generated/types/common.ts:2516
