A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Kinoko::Field::StateManager Class Reference

#include <StateManager.hh>

Description

Base class that represents different "states" for an object.

Some objects inherit from this class in order to define unique behavior depending on what the current "state" of the object is. For example, FireSnakes may be falling from the sun, resting, or jumping. Each state has an "enter" and a "calc" function. The object that inherits this class is responsible for defining how many states there are and must specify the enter and calc functions for each of those states. The object is also responsible for defining the transition points (i.e. the criteria to move from one state to another).

Definition at line 27 of file StateManager.hh.

Inheritance diagram for Kinoko::Field::StateManager:

Protected Member Functions

 StateManager (void *obj, const std::span< const StateManagerEntry > &entries)
 
void calc ()
 

Protected Attributes

u16 m_currentStateId
 
s32 m_nextStateId
 
u32 m_currentFrame
 
std::span< u16m_entryIds
 
std::span< const StateManagerEntrym_entries
 
void * m_obj
 

Constructor & Destructor Documentation

◆ StateManager()

Kinoko::Field::StateManager::StateManager ( void * obj,
const std::span< const StateManagerEntry > & entries )
inlineprotected

Definition at line 29 of file StateManager.hh.

◆ ~StateManager()

virtual Kinoko::Field::StateManager::~StateManager ( )
inlineprotectedvirtual

Definition at line 42 of file StateManager.hh.

Member Function Documentation

◆ calc()

void Kinoko::Field::StateManager::calc ( )
inlineprotected

Definition at line 46 of file StateManager.hh.

Member Data Documentation

◆ m_currentFrame

u32 Kinoko::Field::StateManager::m_currentFrame
protected

Definition at line 64 of file StateManager.hh.

◆ m_currentStateId

u16 Kinoko::Field::StateManager::m_currentStateId
protected

Definition at line 62 of file StateManager.hh.

◆ m_entries

std::span<const StateManagerEntry> Kinoko::Field::StateManager::m_entries
protected

Definition at line 66 of file StateManager.hh.

◆ m_entryIds

std::span<u16> Kinoko::Field::StateManager::m_entryIds
protected

Definition at line 65 of file StateManager.hh.

◆ m_nextStateId

s32 Kinoko::Field::StateManager::m_nextStateId
protected

Definition at line 63 of file StateManager.hh.

◆ m_obj

void* Kinoko::Field::StateManager::m_obj
protected

Definition at line 67 of file StateManager.hh.