GameTimer.ixx File
A game timer that tracks elapsed time and supports state transitions. More...
Included Headers
#include <helios.engine.mechanics.timing.types>
#include <helios.engine.mechanics.timing.types.GameTimerId>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | mechanics |
|
High-level gameplay systems and components for game logic. More... | |
| namespace | timing |
|
Game timer management system. More... | |
Classes Index
| class | GameTimer |
|
A game timer identified by a GameTimerId. 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::mechanics::timing::types;
14using namespace helios::engine::mechanics::timing::types;
16export namespace helios::engine::mechanics::timing {
32 TimerRevision timerRevision_{};
37 GameTimerId gameTimerId_;
47 TimerState timerState_{};
61 explicit GameTimer(const helios::engine::mechanics::timing::types::GameTimerId gameTimerId)
62 : gameTimerId_{gameTimerId} {}
69 [[nodiscard]] helios::engine::mechanics::timing::types::GameTimerId gameTimerId() const noexcept {
78 void reset(const TimerState state = TimerState::Undefined) noexcept {
90 reset(TimerState::Running);
107 void setDuration(float duration) {
108 duration_ = duration;
134 [[nodiscard]] TimerState state() const noexcept {
143 void setState(const TimerState state) noexcept {
144 timerState_ = state;
153 [[nodiscard]] bool shouldUpdate() const noexcept {
154 return (timerState_ == TimerState::Running);
162 [[nodiscard]] bool isFinished() const noexcept {
163 return (timerState_ == TimerState::Finished);
171 [[nodiscard]] TimerRevision timerRevision() const noexcept {
184 if (!shouldUpdate() || ft == 0.0f) {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.