Timer.ixx File
A game timer that tracks elapsed time and supports state transitions. More...
Included Headers
#include <helios.engine.runtime.timing.types>
#include <helios.engine.runtime.timing.types.TimerId>
Namespaces Index
| namespace | helios |
| namespace | engine |
| namespace | runtime |
| namespace | timing |
Classes Index
| class | Timer |
|
A game timer identified by a TimerId. More... | |
Description
A game timer that tracks elapsed time and supports state transitions.
File Listing
The file content with the documentation metadata removed is:
13using namespace helios::engine::runtime::timing::types;
14using namespace helios::engine::runtime::timing::types;
16export namespace helios::engine::runtime::timing {
32 TimerRevision timerRevision_{};
37 TimerId timerId_;
47 TimerState timerState_{};
61 explicit Timer(const helios::engine::runtime::timing::types::TimerId timerId)
62 : timerId_{timerId} {}
78 void reset(const TimerState state = TimerState::Undefined) noexcept {
90 reset(TimerState::Running);
99 reset(TimerState::Cancelled);
107 void setDuration(float duration) {
108 duration_ = duration;
143 void setState(const TimerState state) noexcept {
144 timerState_ = state;
153 [[nodiscard]] bool shouldUpdate() const noexcept {
162 [[nodiscard]] bool isFinished() const noexcept {
171 [[nodiscard]] TimerRevision timerRevision() const noexcept {
184 if (!shouldUpdate() || ft == 0.0f) {
188 elapsed_ += ft;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.