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
, ROTATE = 2
, CLEAR = 3
} |
|
|
| runtime_stack (const runtime_app::context &ctx) |
|
void | push_state (state::ID state_id) noexcept |
|
void | pop_state () noexcept |
|
void | clear_states () noexcept |
|
void | rotate () noexcept |
| void | visit_states (randomizer &rng, 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.
|
|
std::size_t | count () const noexcept |
|
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 |
( |
randomizer & | rng, |
|
|
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
-
| rng | The randomizer instance to use for state updates |
| elapsed | The elapsed time since the last update |
The documentation for this class was generated from the following file: