UpdateContext Class
Per-frame context passed to systems during game loop updates. More...
Declaration
Public Constructors Index
| UpdateContext (helios::engine::runtime::world::Session &session, helios::engine::runtime::world::RuntimeEnvironment &runtimeEnvironment, const float deltaTime, const float totalTime, helios::engine::runtime::messaging::event::GameLoopEventBus &phaseEventBus, helios::engine::runtime::messaging::event::GameLoopEventBus &passEventBus, helios::engine::runtime::messaging::event::GameLoopEventBus &frameEventBus, const helios::engine::input::InputSnapshot &inputSnapshot, const Level *level, EngineWorld &engineWorld) | |
|
Constructs an UpdateContext with all per-frame dependencies. More... | |
Public Member Functions Index
| float | deltaTime () const noexcept |
|
Returns the time elapsed since the last frame, in seconds. More... | |
| float | totalTime () const noexcept |
|
Returns the time elapsed since the first frame, in seconds. More... | |
| const helios::engine::input::InputSnapshot & | inputSnapshot () const noexcept |
|
Returns the immutable input snapshot for this frame. More... | |
template <typename THandle> | |
| auto | find (const THandle handle) noexcept |
|
Resolves an entity facade by typed handle. More... | |
| const Level * | level () noexcept |
| helios::engine::runtime::world::Session & | session () const noexcept |
|
Returns the session for game/match state access. More... | |
| helios::engine::runtime::world::RuntimeEnvironment & | runtimeEnvironment () const noexcept |
|
Returns the runtime environment for platform/runtime readiness state. More... | |
template <typename E, typename... Args> | |
| void | pushPass (Args &&... args) |
|
Pushes an event to the pass-level event bus. More... | |
template <typename E, typename... Args> | |
| void | pushPhase (Args &&... args) |
|
Pushes an event to the phase-level event bus. More... | |
template <typename E> | |
| auto | readPhase () -> std::span< const E > |
|
Reads events from the phase-level event bus. More... | |
template <typename E> | |
| auto | readPass () -> std::span< const E > |
|
Reads events from the pass-level event bus. More... | |
template <typename E> | |
| auto | readFrame () -> std::span< const E > |
|
Reads events from the frame-level event bus. More... | |
template <typename E, typename... Args> | |
| void | pushFrame (Args &&... args) |
|
Pushes an event to the frame-level event bus. More... | |
template <typename THandle, typename... Components> | |
| auto | view () |
|
Builds a typed ECS view for a handle domain and component set. More... | |
Private Member Attributes Index
| float | deltaTime_ = 0.0f |
|
Time elapsed since the last frame, in seconds. More... | |
| float | totalTime_ = 0.0f |
|
Time elapsed since the first frame, in seconds. More... | |
| const helios::engine::input::InputSnapshot & | inputSnapshot_ |
|
Immutable snapshot of input state for the current frame. More... | |
| helios::engine::runtime::world::Session & | session_ |
|
Reference to the current game session for state tracking. More... | |
| helios::engine::runtime::world::RuntimeEnvironment & | runtimeEnvironment_ |
|
Reference to the current platform entity. More... | |
| helios::engine::runtime::messaging::event::GameLoopEventBus::WriteSink | phaseEventSink_ |
|
Sink for pushing phase-level events during update. More... | |
| const helios::engine::runtime::messaging::event::GameLoopEventBus::ReadSource | phaseEventSource_ |
|
Source for reading phase-level events from the previous phase. More... | |
| helios::engine::runtime::messaging::event::GameLoopEventBus::WriteSink | passEventSink_ |
|
Sink for pushing pass-level events during update. More... | |
| const helios::engine::runtime::messaging::event::GameLoopEventBus::ReadSource | passEventSource_ |
|
Source for reading pass-level events from previous passes. More... | |
| helios::engine::runtime::messaging::event::GameLoopEventBus::WriteSink | frameEventSink_ |
|
Sink for pushing frame-level events during update. More... | |
| const helios::engine::runtime::messaging::event::GameLoopEventBus::ReadSource | frameEventSource_ |
|
Source for reading frame-level events from the previous frame. More... | |
| const Level * | level_ |
|
Pointer to the active Level, or nullptr if no level is loaded. More... | |
| helios::engine::runtime::world::EngineWorld & | engineWorld_ |
|
Aggregate typed world used for domain-routed ECS operations. More... | |
Description
Per-frame context passed to systems during game loop updates.
UpdateContext bundles frame-scoped data and services used by system updates: timing values, immutable input/viewport snapshots, session/runtime environment access, typed entity access via EngineWorld, event-bus read/write channels, and typed ECS access.
Command submission is handled by systems through injected command buffers (CommandBuffer_type) using cmdBuffer.template add<TCommand>(...).
- See Also
GameLoop
- See Also
- See Also
- See Also
- See Also
Definition at line 46 of file UpdateContext.ixx.
Public Constructors
UpdateContext()
| inline |
Constructs an UpdateContext with all per-frame dependencies.
- Parameters
-
session Reference to current session state.
runtimeEnvironment Reference to runtime-environment state.
deltaTime Time since last frame in seconds.
totalTime Accumulated time in seconds.
phaseEventBus Phase-level event bus.
passEventBus Pass-level event bus.
frameEventBus Frame-level event bus.
inputSnapshot Immutable frame input snapshot.
viewportSnapshots Immutable frame viewport snapshot set.
level Active level pointer, or nullptr.
engineWorld Aggregate typed world for entity operations.
Definition at line 141 of file UpdateContext.ixx.
Public Member Functions
deltaTime()
| inline noexcept |
find()
| inline noexcept |
Resolves an entity facade by typed handle.
- Template Parameters
-
THandle Handle type.
- Parameters
-
handle Entity handle to resolve.
- Returns
Domain-specific entity facade.
Definition at line 209 of file UpdateContext.ixx.
Reference helios::engine::runtime::registerComponents.
inputSnapshot()
| inline noexcept |
Returns the immutable input snapshot for this frame.
- Returns
Const ref to the current InputSnapshot.
Definition at line 195 of file UpdateContext.ixx.
level()
| inline noexcept |
pushFrame()
| inline |
Pushes an event to the frame-level event bus.
Events pushed here become readable in the next frame via readFrame(). The frame event bus is swapped at the end of the Post phase in GameLoop.
Use frame-level events for cross-frame communication where events should persist beyond the current phase.
- Template Parameters
-
E The event type to push.
Args Constructor argument types for the event.
- Parameters
-
args Arguments forwarded to the event constructor.
- See Also
- See Also
GameLoop
Definition at line 361 of file UpdateContext.ixx.
Reference helios::engine::runtime::registerComponents.
pushPass()
| inline |
Pushes an event to the pass-level event bus.
Events pushed here become readable in subsequent passes within the same phase, after a commit point is reached.
- Template Parameters
-
E The event type to push.
Args Constructor argument types for the event.
- Parameters
-
args Arguments forwarded to the event constructor.
- See Also
- See Also
Pass::addCommitPoint()
Definition at line 257 of file UpdateContext.ixx.
Reference helios::engine::runtime::registerComponents.
pushPhase()
| inline |
Pushes an event to the phase-level event bus.
Events pushed here become readable in subsequent phases, after the current phase commits.
- Template Parameters
-
E The event type to push.
Args Constructor argument types for the event.
- Parameters
-
args Arguments forwarded to the event constructor.
- See Also
- See Also
GameLoop
Definition at line 276 of file UpdateContext.ixx.
Reference helios::engine::runtime::registerComponents.
readFrame()
| inline |
Reads events from the frame-level event bus.
Returns events that were pushed during the previous frame via pushFrame(). The frame event bus is swapped at the end of the Post phase, making events readable in the subsequent frame.
Frame-level events are useful for cross-frame communication, such as:
- Collision events that trigger effects in the next frame
- Spawn confirmations for UI updates
- Audio/VFX triggers
- Template Parameters
-
E The event type to read.
- Returns
A span of const events of type E.
- See Also
- See Also
GameLoop
Definition at line 338 of file UpdateContext.ixx.
Reference helios::engine::runtime::registerComponents.
readPass()
| inline |
Reads events from the pass-level event bus.
Returns events that were pushed during previous passes within the current phase via pushPass(). The pass event bus is swapped at commit points, configured via Pass::addCommitPoint().
- Template Parameters
-
E The event type to read.
- Returns
A span of const events of type E.
- See Also
- See Also
Pass::addCommitPoint()
Definition at line 314 of file UpdateContext.ixx.
Reference helios::engine::runtime::registerComponents.
readPhase()
| inline |
Reads events from the phase-level event bus.
Returns events that were pushed during the previous phase via pushPhase(). The phase event bus is swapped at phase boundaries, configured in GameLoop::phaseCommit().
- Template Parameters
-
E The event type to read.
- Returns
A span of const events of type E.
- See Also
- See Also
GameLoop
Definition at line 295 of file UpdateContext.ixx.
Reference helios::engine::runtime::registerComponents.
runtimeEnvironment()
| inline noexcept |
Returns the runtime environment for platform/runtime readiness state.
- Returns
Reference to runtime environment.
Definition at line 238 of file UpdateContext.ixx.
session()
| inline noexcept |
Returns the session for game/match state access.
- Returns
Ref to the Session used with this UpdateContext.
Definition at line 229 of file UpdateContext.ixx.
totalTime()
| inline noexcept |
view()
| inline |
Builds a typed ECS view for a handle domain and component set.
- Template Parameters
-
THandle Handle domain type.
Components Component types to include.
- Returns
Domain-specific view.
Definition at line 375 of file UpdateContext.ixx.
References helios::engine::runtime::registerComponents and helios::engine::runtime::world::EngineWorld::view.
Private Member Attributes
deltaTime_
|
Time elapsed since the last frame, in seconds.
Definition at line 52 of file UpdateContext.ixx.
engineWorld_
|
Aggregate typed world used for domain-routed ECS operations.
Definition at line 122 of file UpdateContext.ixx.
frameEventSink_
|
Sink for pushing frame-level events during update.
Used by systems and components to publish events that will be processed in the next frame. Frame-level events persist across all phases and are swapped at the end of the Post phase.
Definition at line 107 of file UpdateContext.ixx.
frameEventSource_
|
Source for reading frame-level events from the previous frame.
Definition at line 112 of file UpdateContext.ixx.
inputSnapshot_
|
Immutable snapshot of input state for the current frame.
Definition at line 62 of file UpdateContext.ixx.
level_
|
Pointer to the active Level, or nullptr if no level is loaded.
Definition at line 117 of file UpdateContext.ixx.
passEventSink_
|
Sink for pushing pass-level events during update.
Used by systems and components to publish events that will be processed in subsequent passes within the same phase, after a commit point.
Definition at line 93 of file UpdateContext.ixx.
passEventSource_
|
Source for reading pass-level events from previous passes.
Definition at line 98 of file UpdateContext.ixx.
phaseEventSink_
|
Sink for pushing phase-level events during update.
Used by systems and components to publish events (e.g., collision, spawn requests) that will be processed in the next phase of the game loop.
Definition at line 80 of file UpdateContext.ixx.
phaseEventSource_
|
Source for reading phase-level events from the previous phase.
Definition at line 85 of file UpdateContext.ixx.
runtimeEnvironment_
|
Reference to the current platform entity.
Definition at line 72 of file UpdateContext.ixx.
session_
|
Reference to the current game session for state tracking.
Definition at line 67 of file UpdateContext.ixx.
totalTime_
|
Time elapsed since the first frame, in seconds.
Definition at line 57 of file UpdateContext.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.