Logo FSBarV1_Archived

MapCache Module

Thread-safe caching layer for MapGrid and passability data. Avoids redundant engine callbacks by caching results using Lazy for safe concurrent access.

Functions and values

Function or value Description

clear ()

Full Usage: clear ()

Parameters:
    () : unit

() : unit

fromEngine stream

Full Usage: fromEngine stream

Parameters:
    stream : NetworkStream - Active network stream to the HighBar V2 proxy.

Returns: MapGrid The cached or newly loaded MapGrid.

Loads a MapGrid from the engine, caching the result. Subsequent calls return the cached grid without additional engine callbacks.

stream : NetworkStream

Active network stream to the HighBar V2 proxy.

Returns: MapGrid

The cached or newly loaded MapGrid.

passability grid moveType

Full Usage: passability grid moveType

Parameters:
    grid : MapGrid - The map grid to compute passability from.
    moveType : MoveType - The unit movement type to compute passability for.

Returns: bool[,] A cached 2D boolean array where true indicates a passable cell.

Gets or computes a passability grid for the given movement type, caching the result. Each MoveType is cached independently.

grid : MapGrid

The map grid to compute passability from.

moveType : MoveType

The unit movement type to compute passability for.

Returns: bool[,]

A cached 2D boolean array where true indicates a passable cell.

refreshDynamic stream

Full Usage: refreshDynamic stream

Parameters:

Clears all cached map grid and passability data. Call this when starting a new game session to avoid stale data.

stream : NetworkStream

Type something to start searching.