@my-swu/simulator-client / GameState
Interface: GameState
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:254
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)Indexable
[
k:string]:unknown
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/game-state.ts:255
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/game-state.ts:256
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/game-state.ts:257
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)
optionalavailableCounters?:TwinSunsCounter[]
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:258
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/game-state.ts:259
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/game-state.ts:260
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:
"trilogy"|"sealed"|"draft"|"premier"|"eternal"|"twinSuns"
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:264
Match format requested at creation time.
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/game-state.ts:265
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/game-state.ts:266
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/game-state.ts:267
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/game-state.ts:268
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/game-state.ts:269
pendingAbilityAspectChoice?
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 { pendingAbilityAspectChoice } = matchSnapshot
console.log(pendingAbilityAspectChoice)
optionalpendingAbilityAspectChoice?:PendingAbilityAspectChoiceView|null
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:270
pendingAbilityAttackChoice?
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 { pendingAbilityAttackChoice } = matchSnapshot
console.log(pendingAbilityAttackChoice)
optionalpendingAbilityAttackChoice?:PendingAbilityAttackChoiceView|null
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:271
pendingAbilityCardChoice?
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 { pendingAbilityCardChoice } = matchSnapshot
console.log(pendingAbilityCardChoice)
optionalpendingAbilityCardChoice?:PendingAbilityCardChoiceView|null
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:272
pendingAbilityModeChoice?
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 { pendingAbilityModeChoice } = matchSnapshot
console.log(pendingAbilityModeChoice)
optionalpendingAbilityModeChoice?:PendingAbilityModeChoiceView|null
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:273
pendingAbilityNameChoice?
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 { pendingAbilityNameChoice } = matchSnapshot
console.log(pendingAbilityNameChoice)
optionalpendingAbilityNameChoice?:PendingAbilityNameChoiceView|null
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:274
pendingIndirectDamage?
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 { pendingIndirectDamage } = matchSnapshot
console.log(pendingIndirectDamage)
optionalpendingIndirectDamage?:PendingIndirectDamageView|null
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:275
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/game-state.ts:276
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/game-state.ts:277
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/game-state.ts:281
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/game-state.ts:282
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/game-state.ts:283
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/game-state.ts:284
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/game-state.ts:285
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/game-state.ts:286
seed
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 { seed } = matchSnapshot
console.log(seed)seed:
number
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:287
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/game-state.ts:288
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/game-state.ts:289
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/game-state.ts:290
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/game-state.ts:291
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/game-state.ts:292
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)
optionalwinners?:Seat[]
Defined in: packages/ts-sdk/src/generated/types/game-state.ts:293
