Maze Builder Docs 8.2.1
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 , CLEAR = 2 }
 

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 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.
 

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 ( 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
argsThe optional arguments to pass to each state's update function
elapsedThe elapsed time since the last update

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