Skip to main content

TimerClearSystem Class

Resets finished game timers to an undefined state. More...

Declaration​

class helios::engine::runtime::timing::systems::TimerClearSystem { ... }

Public Member Typedefs Index​

usingEngineRoleTag = helios::engine::runtime::world::tags::TypedSystemRole

Public Constructors Index​

TimerClearSystem (TimerManager &timerManager)

Constructs the system with a reference to the TimerManager. More...

Public Member Functions Index​

voidupdate (helios::engine::runtime::world::UpdateContext &updateContext) noexcept

Resets all finished timers to TimerState::Undefined. More...

Private Member Attributes Index​

TimerManager &timerManager_

Reference to the TimerManager owning the timers. More...

Description​

Resets finished game timers to an undefined state.

Each frame, this system iterates over all registered timers and resets any timer whose state is TimerState::Finished back to TimerState::Undefined. This ensures that one-shot timer completions are consumed within a single frame and do not trigger downstream logic more than once.

See Also

TimerManager

See Also

Timer

Definition at line 38 of file TimerClearSystem.ixx.

Public Member Typedefs​

EngineRoleTag​

using helios::engine::runtime::timing::systems::TimerClearSystem::EngineRoleTag = helios::engine::runtime::world::tags::TypedSystemRole

Public Constructors​

TimerClearSystem()​

helios::engine::runtime::timing::systems::TimerClearSystem::TimerClearSystem (TimerManager & timerManager)
inline explicit

Constructs the system with a reference to the TimerManager.

Parameters
timerManager

The manager whose timers are cleared.

Definition at line 55 of file TimerClearSystem.ixx.

56 : timerManager_(timerManager) {}

Public Member Functions​

update()​

void helios::engine::runtime::timing::systems::TimerClearSystem::update (helios::engine::runtime::world::UpdateContext & updateContext)
inline noexcept

Resets all finished timers to TimerState::Undefined.

Parameters
updateContext

The current frame's update context.

Definition at line 63 of file TimerClearSystem.ixx.

64
65 for (auto& timer : timerManager_.timers()) {
66 if (timer.state() == TimerState::Finished || timer.state() == TimerState::Cancelled) {
67 timer.setState(TimerState::Undefined);
68 }
69 }
70 }

References helios::engine::runtime::registerComponents and helios::engine::runtime::timing::TimerManager::timers.

Private Member Attributes​

timerManager_​

TimerManager& helios::engine::runtime::timing::systems::TimerClearSystem::timerManager_

Reference to the TimerManager owning the timers.

Definition at line 43 of file TimerClearSystem.ixx.

43 TimerManager& timerManager_;

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.