Skip to content

@lands.io/mod-sdk / ActionContext

Interface: ActionContext

Context provided to actions for validation and target selection. All types here are SDK interfaces, not internal implementations.

Table of contents

Properties

Properties

attackId

Optional attackId: string

Optional: Attack ID for retreat actions


game

game: Game

The current game instance


player

player: Player

The player performing the action


random

random: PseudoRandom

Deterministic random for AI behavior


sourceSelectionTile

Optional sourceSelectionTile: number

Optional: Source selection tile for breakthrough-style attacks


targetTile

Optional targetTile: number

Optional: Target tile from UI click


Source Code

View full implementation
/**
 * Context provided to actions for validation and target selection.
 * All types here are SDK interfaces, not internal implementations.
 */
export interface ActionContext {
  /** The current game instance */
  game: Game;

  /** The player performing the action */
  player: Player;

  /** Optional: Target tile from UI click */
  targetTile?: TileRef;

  /** Optional: Source selection tile for breakthrough-style attacks */
  sourceSelectionTile?: TileRef;

  /** Optional: Attack ID for retreat actions */
  attackId?: string;

  /** Deterministic random for AI behavior */
  random: PseudoRandom;
}