galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::State Class Referenceabstract

A state to use in a finite state machine. More...

#include <State.hpp>

Inheritance diagram for galaxy::State:
Collaboration diagram for galaxy::State:

Public Member Functions

 State (State &&)=default
 Move constructor.
Stateoperator= (State &&)=default
 Move assignment operator.
 State (const State &)=default
 Copy constructor.
Stateoperator= (const State &)=default
 Copy assignment operator.
virtual ~State ()=default
 Virtual destructor.
virtual void on_push ()=0
 Triggered when state is pushed onto the stack.
virtual void on_pop ()=0
 Triggered when state is popped off the stack.
const std::string & name () const noexcept
 Get state name.

Protected Member Functions

 State (const std::string &name) noexcept
 Name constructor.

Protected Attributes

std::string m_name
 Name for debug purposes.

Private Member Functions

 State ()=delete
 Constructor.

Detailed Description

A state to use in a finite state machine.

Definition at line 18 of file State.hpp.

Constructor & Destructor Documentation

◆ State() [1/4]

galaxy::State::State ( State && )
default

Move constructor.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ State() [2/4]

galaxy::State::State ( const State & )
default

Copy constructor.

Here is the call graph for this function:

◆ ~State()

virtual galaxy::State::~State ( )
virtualdefault

Virtual destructor.

◆ State() [3/4]

galaxy::State::State ( const std::string & name)
protectednoexcept

Name constructor.

Parameters
nameName of the scene for debug / editor purposes.

Definition at line 12 of file State.cpp.

Here is the call graph for this function:

◆ State() [4/4]

galaxy::State::State ( )
privatedelete

Constructor.

Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

State & galaxy::State::operator= ( State && )
default

Move assignment operator.

Here is the call graph for this function:

◆ operator=() [2/2]

State & galaxy::State::operator= ( const State & )
default

Copy assignment operator.

Here is the call graph for this function:

◆ on_push()

virtual void galaxy::State::on_push ( )
pure virtual

Triggered when state is pushed onto the stack.

Implemented in galaxy::Scene.

Here is the caller graph for this function:

◆ on_pop()

virtual void galaxy::State::on_pop ( )
pure virtual

Triggered when state is popped off the stack.

Implemented in galaxy::Scene.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name()

const std::string & galaxy::State::name ( ) const
nodiscardnoexcept

Get state name.

Returns
Const string.

Definition at line 17 of file State.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ m_name

std::string galaxy::State::m_name
protected

Name for debug purposes.

Definition at line 76 of file State.hpp.


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