Class representing the runtime stack of states in the maze builder application.
More...
#include <runtime_stack.h>
|
| enum class | operation : unsigned int { PUSH = 0
, POP = 1
, CLEAR = 2
} |
| |
|
|
| runtime_stack (const runtime_app::context &ctx) |
| |
|
void | push_state (state::ID state_id) noexcept |
| |
|
void | pop_state () noexcept |
| |
|
void | clear_states () noexcept |
| |
| void | visit_states (const std::optional< args > &args, double elapsed) noexcept |
| | Visit each state top-to-bottom, calling update(args, elapsed) until one returns false. Applies pending stack changes after the pass.
|
| |
| bool | is_empty () const noexcept |
| | Checks if the runtime stack is empty.
|
| |
|
template<typename T > |
| void | register_state (state::ID state_id) |
| | Register a factory for a concrete state type. The factory is called with (runtime_context, this).
|
| |
|
template<typename Pointer > |
| Pointer | peek_state () const noexcept |
| | Find the topmost state that matches the pointer type T.
|
| |
Class representing the runtime stack of states in the maze builder application.
◆ is_empty()
| bool mazes::runtime_stack::is_empty |
( |
| ) |
const |
|
nodiscardnoexcept |
Checks if the runtime stack is empty.
- Returns
- True if the stack is empty, false otherwise
◆ visit_states()
| void mazes::runtime_stack::visit_states |
( |
const std::optional< args > & | args, |
|
|
double | elapsed ) |
|
noexcept |
Visit each state top-to-bottom, calling update(args, elapsed) until one returns false. Applies pending stack changes after the pass.
- Parameters
-
| args | The optional arguments to pass to each state's update function |
| elapsed | The elapsed time since the last update |
The documentation for this class was generated from the following file: