MapGrid Module
Functions for loading, refreshing, and querying MapGrid data. Provides terrain classification, passability analysis, and active patterns for pattern matching.
Functions and values
| Function or value |
Description
|
||
Full Usage:
loadFromEngine stream
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
Returns: MapGrid
A fully populated MapGrid.
|
Loads all map layers (height, slope, resource, LOS, radar) from the engine and assembles them into a MapGrid record with properly shaped 2D arrays.
|
||
|
Computes a boolean passability grid for the given movement type.
Each cell is
|
||
Full Usage:
refreshLos stream grid
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
grid : MapGrid
-
The existing map grid to update.
Returns: MapGrid
A new MapGrid with the LOS layer refreshed.
|
Refreshes only the line-of-sight layer from the engine, returning an updated grid. Call this each frame to get current visibility data without reloading static layers.
|
||
Full Usage:
refreshRadar stream grid
Parameters:
NetworkStream
-
Active network stream to the HighBar V2 proxy.
grid : MapGrid
-
The existing map grid to update.
Returns: MapGrid
A new MapGrid with the radar layer refreshed.
|
Refreshes only the radar layer from the engine, returning an updated grid. Call this each frame to get current radar coverage without reloading static layers.
|
||
|
Classifies the terrain at a heightmap grid cell based on height and slope. Cells below sea level are Water, cells with slope above 0.6 are Cliff, otherwise Land.
|
Active patterns
| Active pattern |
Description
|
|
|
Full Usage:
(|Passable|Impassable|) grid moveType x z
Parameters:
MapGrid
-
The map grid containing height and slope data.
moveType : MoveType
-
The unit movement type to check passability for.
x : int
-
Heightmap grid X coordinate.
z : int
-
Heightmap grid Z coordinate.
Returns: Choice<unit, unit>
Passable or Impassable.
|
Active pattern that checks whether a heightmap cell is passable for a given movement type. Returns Passable if the cell is within bounds and traversable, Impassable otherwise.
|
FSBarV1_Archived