Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / leaderDeployCommand

Function: leaderDeployCommand() ​

leaderDeployCommand(action): GameCommand

Defined in: packages/ts-sdk/src/actionable.ts:101

Builds the gameplay command for one projected leader deploy action.

Example:

ts
import { createSimulatorClient, leaderDeployCommand } 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',
})

const matchSnapshot = await simulatorClient.matches.get('match_123')

// Deploy actions carry the leader slot and pilot attachment the command needs.
const [leaderDeployAction] = matchSnapshot.availableLeaderDeploys

if (leaderDeployAction != null) {
  console.log(leaderDeployCommand(leaderDeployAction))
}

Parameters ​

action ​

Example:

ts
import { createSimulatorClient, leaderDeployCommand } 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',
})

const matchSnapshot = await simulatorClient.matches.get('match_123')

// Deploy actions carry the leader slot and pilot attachment the command needs.
const [leaderDeployAction] = matchSnapshot.availableLeaderDeploys

if (leaderDeployAction != null) {
  console.log(leaderDeployCommand(leaderDeployAction))
}

LeaderDeployActionView

Returns ​

GameCommand

Released under the MIT License.