Plasma Engine  2.0
Loading...
Searching...
No Matches
plStateMachineState Class Referenceabstract

Base class for a state in a state machine. More...

#include <StateMachine.h>

Inheritance diagram for plStateMachineState:

Public Member Functions

 plStateMachineState (plStringView sName=plStringView())
 
void SetName (plStringView sName)
 
plStringView GetName () const
 
const plHashedStringGetNameHashed () const
 
virtual void OnEnter (plStateMachineInstance &ref_instance, void *pInstanceData, const plStateMachineState *pFromState) const =0
 
virtual void OnExit (plStateMachineInstance &ref_instance, void *pInstanceData, const plStateMachineState *pToState) const
 
virtual void Update (plStateMachineInstance &ref_instance, void *pInstanceData, plTime deltaTime) const
 
virtual plResult Serialize (plStreamWriter &inout_stream) const
 
virtual plResult Deserialize (plStreamReader &inout_stream)
 
virtual bool GetInstanceDataDesc (plInstanceDataDesc &out_desc)
 Returns whether this state needs additional instance data and if so fills the out_desc.
 
- Public Member Functions inherited from plReflectedClass
virtual const plRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const plRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
PL_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Additional Inherited Members

- Static Public Member Functions inherited from plNoBase
static const plRTTIGetStaticRTTI ()
 

Detailed Description

Base class for a state in a state machine.

Note that states are shared between multiple instances and thus shouldn't modify any data on their own but always operate on the passed instance and instance data.

See also
plStateMachineInstanceDataDesc

Member Function Documentation

◆ GetInstanceDataDesc()

bool plStateMachineState::GetInstanceDataDesc ( plInstanceDataDesc & out_desc)
virtual

Returns whether this state needs additional instance data and if so fills the out_desc.

See also
plStateMachineInstanceDataDesc

Reimplemented in plStateMachineState_Compound, plStateMachineState_NestedStateMachine, and plStateMachineState_Script.


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