Maze Builder Docs 8.10.23
Loading...
Searching...
No Matches
mazes::runtime_stack Class Referencefinal

Class representing the runtime stack of states in the maze builder application. More...

#include <runtime_stack.h>

Public Types

enum class  Operation : unsigned int { PUSH = 0 , POP = 1 , ROTATE = 2 , CLEAR = 3 }

Public Member Functions

 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.

Detailed Description

Class representing the runtime stack of states in the maze builder application.

Member Function Documentation

◆ 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
rngThe randomizer instance to use for state updates
elapsedThe elapsed time since the last update

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