2022-02-03 09:13:49 -05:00
|
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include "StateTreeTypes.h"
|
|
|
|
|
|
#include "StateTreeNodeBase.generated.h"
|
|
|
|
|
|
|
2022-04-06 10:04:05 -04:00
|
|
|
|
struct FStateTreeLinker;
|
|
|
|
|
|
|
2022-02-03 09:13:49 -05:00
|
|
|
|
/**
|
|
|
|
|
|
* Base struct of StateTree Conditions, Evaluators, and Tasks.
|
|
|
|
|
|
*/
|
|
|
|
|
|
USTRUCT()
|
|
|
|
|
|
struct STATETREEMODULE_API FStateTreeNodeBase
|
|
|
|
|
|
{
|
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
|
|
FStateTreeNodeBase() = default;
|
|
|
|
|
|
|
|
|
|
|
|
virtual ~FStateTreeNodeBase() {}
|
|
|
|
|
|
|
2022-04-04 13:53:17 -04:00
|
|
|
|
/** @return Struct that represents the runtime data of the node. */
|
2022-02-03 09:13:49 -05:00
|
|
|
|
virtual const UStruct* GetInstanceDataType() const { return nullptr; };
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Called when the StateTree asset is linked. Allows to resolve references to other StateTree data.
|
|
|
|
|
|
* @see TStateTreeExternalDataHandle
|
|
|
|
|
|
* @see TStateTreeInstanceDataPropertyHandle
|
|
|
|
|
|
* @param Linker Reference to the linker
|
|
|
|
|
|
* @return true if linking succeeded.
|
|
|
|
|
|
*/
|
2022-04-06 10:04:05 -04:00
|
|
|
|
[[nodiscard]] virtual bool Link(FStateTreeLinker& Linker) { return true; }
|
2022-02-03 09:13:49 -05:00
|
|
|
|
|
|
|
|
|
|
/** Name of the node. */
|
|
|
|
|
|
UPROPERTY(EditDefaultsOnly, Category = "", meta=(EditCondition = "false", EditConditionHides))
|
|
|
|
|
|
FName Name;
|
|
|
|
|
|
|
|
|
|
|
|
/** Property binding copy batch handle. */
|
|
|
|
|
|
UPROPERTY()
|
2022-05-31 04:51:18 -04:00
|
|
|
|
FStateTreeIndex16 BindingsBatch = FStateTreeIndex16::Invalid;
|
2022-02-03 09:13:49 -05:00
|
|
|
|
|
|
|
|
|
|
/** The runtime data's data view index in the StateTreeExecutionContext, and source struct index in property binding. */
|
|
|
|
|
|
UPROPERTY()
|
2022-05-31 04:51:18 -04:00
|
|
|
|
FStateTreeIndex16 DataViewIndex = FStateTreeIndex16::Invalid;
|
2022-02-03 09:13:49 -05:00
|
|
|
|
|
|
|
|
|
|
/** Index in runtime instance storage. */
|
|
|
|
|
|
UPROPERTY()
|
2022-05-31 04:51:18 -04:00
|
|
|
|
FStateTreeIndex16 InstanceIndex = FStateTreeIndex16::Invalid;
|
2022-02-03 09:13:49 -05:00
|
|
|
|
|
|
|
|
|
|
/** True if the instance is an UObject. */
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
|
uint8 bInstanceIsObject : 1;
|
|
|
|
|
|
};
|