3#include <GameEngine/StateMachine/Implementation/StateMachineInstanceData.h>
5#include <Foundation/Reflection/Reflection.h>
6#include <Foundation/Strings/HashedString.h>
7#include <Foundation/Types/SharedPtr.h>
118 struct TransitionContext
121 plUInt32 m_uiToStateIndex = 0;
122 plUInt32 m_uiInstanceDataOffset = plInvalidIndex;
132 plUInt32 m_uiInstanceDataOffset = plInvalidIndex;
152 plResult SetState(plUInt32 uiStateIndex);
157 void Update(
plTime deltaTime);
171 plStringView GetCurrentTransitionEvent()
const {
return m_sCurrentTransitionEvent; }
178 plBlackboard* Reflection_GetBlackboard()
const {
return m_pBlackboard.Borrow(); }
180 void SetStateInternal(plUInt32 uiStateIndex);
183 plUInt32 FindNewStateToTransitionTo();
185 PL_ALWAYS_INLINE
void* GetInstanceData(plUInt32 uiOffset)
190 PL_ALWAYS_INLINE
void* GetCurrentStateInstanceData()
192 if (m_pDescription !=
nullptr && m_uiCurrentStateIndex < m_pDescription->m_States.GetCount())
194 return GetInstanceData(m_pDescription->m_States[m_uiCurrentStateIndex].m_uiInstanceDataOffset);
204 plUInt32 m_uiCurrentStateIndex = plInvalidIndex;
205 plTime m_TimeInCurrentState;
A blackboard is a key/value store that provides OnChange events to be informed when a value changes.
Definition Blackboard.h:66
plBlob allows to store simple binary data larger than 4GB. This storage class is used by plImage to a...
Definition Blob.h:319
Base class of all component types.
Definition Component.h:25
Definition DynamicArray.h:81
Definition HashTable.h:333
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
Helper class to manager instance data allocation, construction and destruction.
Definition InstanceDataAllocator.h:35
static PL_ALWAYS_INLINE void * GetInstanceData(const plByteBlobPtr &blobPtr, plUInt32 uiOffset)
Retrieves a void pointer to the instance data within the given blob at the given offset,...
Definition InstanceDataAllocator.h:59
Base class for reference counted objects.
Definition RefCounted.h:52
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
A Shared ptr manages a shared object and destroys that object when no one references it anymore....
Definition SharedPtr.h:10
The state machine description defines the structure of a state machine like e.g. what states it has a...
Definition StateMachine.h:99
The state machine instance represents the actual state machine. Typically it is created from a descri...
Definition StateMachine.h:144
plTime GetTimeInCurrentState() const
Returns how long the state machine is in its current state.
Definition StateMachine.h:166
Definition StateMachine.h:52
Base class for a state in a state machine.
Definition StateMachine.h:20
Base class for a transition in a state machine. The target state of a transition is automatically set...
Definition StateMachine.h:81
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
Structure to describe an instance data type.
Definition InstanceDataAllocator.h:17
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
Definition StateMachine.h:63
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12