Navigation
API > API/Plugins > API/Plugins/StateTreeModule
References
| Module | StateTreeModule |
| Header | /Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/StateTreeInstanceData.h |
| Include | #include "StateTreeInstanceData.h" |
Syntax
template<typename T>
struct TStateTreeInstanceDataStructRef
Remarks
Stores indexed reference to a instance data struct. The instance data structs may be relocated when the instance data composition changed. For that reason you cannot store pointers to the instance data. This is often needed for example when dealing with delegate lambda's. This helper struct stores data to be able to find the instance data in the instance data array. That way we can access the instance data even of the array changes, and the instance data moves in memory.
Note that the reference is valid only during the lifetime of a task (between a call EnterState() and ExitState()).
You generally do not use this directly, but via FStateTreeExecutionContext.
EStateTreeRunStatus FTestTask::EnterState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const { FInstanceDataType& InstanceData = Context.GetInstanceData(*this);
Context.GetWorld()->GetTimerManager().SetTimer( InstanceData.TimerHandle, InstanceDataRef = Context.GetInstanceDataStructRef(this) { if (FInstanceDataType InstanceData = InstanceDataRef.GetPtr()) { ... } }, Delay, true);
return EStateTreeRunStatus::Running; }
Variables
| Type | Name | Description | |
|---|---|---|---|
| FStateTreeDataHandle | DataHandle | ||
| FStateTreeStateHandle | RootState | ||
| TWeakObjectPtr< const UStateTree > | WeakStateTree | ||
| TWeakPtr< FStateTreeInstanceStorage > | WeakStorage |
Constructors
| Type | Name | Description | |
|---|---|---|---|
TStateTreeInstanceDataStructRef
(
FStateTreeInstanceData& InInstanceData, |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FStructView | GetDataView
(
FStateTreeInstanceStorage& Storage, |
||
| T * | GetPtr () |
||
| bool | IsHandleSourceValid
(
FStateTreeInstanceStorage& Storage, |
||
| bool | IsValid () |
Operators
| Type | Name | Description | |
|---|---|---|---|
| T & | operator* () |