Logo FSBarV1_Archived

GameState Module

Functions for creating and updating game state.

Functions and values

Function or value Description

applySnapshot state snapshot

Full Usage: applySnapshot state snapshot

Parameters:
Returns: GameState

Pure mapper: applies a batched GameStateSnapshotResult (from Callbacks.getGameStateSnapshot) to an existing GameState. Returns the updated state with Units, Enemies, Metal, and Energy replaced per spec 045 §Mapping.

Enemies absent from both LosEnemies and RadarOnlyEnemies retain their prior Position but have InLOS/InRadar cleared and Health = None (FR-007 frozen-last-known). Radar-only entries always carry Health = None even when the prior state had Some _ (FR-004).

state : GameState
snapshot : GameStateSnapshotResult
Returns: GameState

empty

Full Usage: empty

Returns: GameState

Creates an empty initial game state.

Returns: GameState

processFrame state frame stream

Full Usage: processFrame state frame stream

Parameters:
Returns: GameState

Processes a game frame and returns the updated game state.

state : GameState
frame : GameFrame
stream : NetworkStream
Returns: GameState

Type something to start searching.