Class TrailblazerWorldContext
- Namespace
- Trailblazer
- Assembly
- Trailblazer.dll
Owns Trailblazer runtime state for one explicit GridForge.Grids.GridWorld.
public sealed class TrailblazerWorldContext : IDisposable
- Inheritance
-
TrailblazerWorldContext
- Implements
- Inherited Members
Remarks
This is the context-first host API for multi-world Trailblazer usage. It owns world lifetime, deterministic clock state, pathing state, reachability snapshots, and guide caches.
Properties
AccumulatedTime
Gets this context's accumulated visualization time.
public Fixed64 AccumulatedTime { get; }
Property Value
- Fixed64
DeltaTime
Gets this context's fixed simulation time step.
public Fixed64 DeltaTime { get; }
Property Value
- Fixed64
ExpectedAccumulation
Gets this context's visualization accumulation expressed in simulation frames.
public Fixed64 ExpectedAccumulation { get; }
Property Value
- Fixed64
FrameCount
Gets this context's simulated frame count.
public int FrameCount { get; }
Property Value
FrameRate
Gets this context's fixed simulation frame rate.
public int FrameRate { get; }
Property Value
Guides
Gets this context's world-local path guide service.
public TrailblazerGuideService Guides { get; }
Property Value
Heightmaps
Gets this context's world-local heightmap registry and sampling service.
public TrailblazerHeightmapService Heightmaps { get; }
Property Value
InvDeltaTime
Gets the reciprocal of this context's fixed simulation time step.
public Fixed64 InvDeltaTime { get; }
Property Value
- Fixed64
IsDisposed
Gets whether this context has been disposed.
public bool IsDisposed { get; }
Property Value
Pathing
Gets this context's world-local pathing service.
public TrailblazerPathingService Pathing { get; }
Property Value
ResetAccumulation
Gets whether this context's visualization accumulation will reset on the next visualize call.
public bool ResetAccumulation { get; }
Property Value
Settings
Gets the immutable finite runtime ceilings for this context.
public TrailblazerWorldContextSettings Settings { get; }
Property Value
TotalTime
Gets this context's total simulated time.
public Fixed64 TotalTime { get; }
Property Value
- Fixed64
World
Gets the explicit GridForge world owned or referenced by this context.
public GridWorld World { get; }
Property Value
- GridWorld
Methods
Attach(GridWorld, bool, TrailblazerWorldContextSettings?)
Attaches a context to a host-owned GridForge.Grids.GridWorld.
public static TrailblazerWorldContext Attach(GridWorld world, bool takeOwnership = false, TrailblazerWorldContextSettings? settings = null)
Parameters
worldGridWorldThe active world to bind.
takeOwnershipboolTrue when disposing this context should dispose the supplied world.
settingsTrailblazerWorldContextSettingsOptional immutable context ceilings; defaults to the recommended finite settings.
Returns
- TrailblazerWorldContext
A context bound to
world.
CreateOwned(int, TrailblazerWorldContextSettings?)
Creates a context with an owned GridForge.Grids.GridWorld.
public static TrailblazerWorldContext CreateOwned(int spatialGridCellSize = 50, TrailblazerWorldContextSettings? settings = null)
Parameters
spatialGridCellSizeintSpatial hash cell size for the created world.
settingsTrailblazerWorldContextSettingsOptional immutable context ceilings; defaults to the recommended finite settings.
Returns
- TrailblazerWorldContext
A context that owns its created world.
Dispose()
public void Dispose()
GetFrameFromTime(Fixed64)
Calculates the frame index containing the specified fixed-point timestamp.
public int GetFrameFromTime(Fixed64 timestamp)
Parameters
timestampFixed64The timestamp to resolve.
Returns
- int
The zero-based frame index for the timestamp.
LateSimulate()
Runs this context's late-simulation step.
public void LateSimulate()
Reset()
Resets this context's deterministic clock and context-local lifecycle hooks.
public void Reset()
SetFrameRate(int)
Updates this context's fixed simulation frame rate.
public void SetFrameRate(int frameRate)
Parameters
frameRateintThe new frame rate. Must be greater than zero.
Simulate()
Advances this context's deterministic simulation clock and ordered simulate hooks.
public void Simulate()
Visualize()
Runs this context's visualization accumulation step.
public void Visualize()