Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/Blueprint/StateTreeItemBlueprintBase.h
jamie dale cfdad64946 Added context to PostCDOCompiled and also call it for skeleton-only compiles
#jira
#preflight 6210112553204823ae8bcf4f
#rb Michael.Noland

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 19058032 via CL 19058041 via CL 19058078 via CL 19058094 via CL 19059619
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19066317 by jamie dale in ue5-main branch]
2022-02-21 02:04:58 -05:00

71 lines
1.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "StateTreeTypes.h"
#include "StateTreeItemBlueprintBase.generated.h"
struct FStateTreeExecutionContext;
UENUM()
enum class EStateTreeBlueprintPropertyCategory : uint8
{
NotSet,
Input,
Parameter,
Output,
ExternalData,
};
/** Additional information for properties, captured from property metadata. */
USTRUCT()
struct STATETREEMODULE_API FStateTreeBlueprintPropertyInfo
{
GENERATED_BODY()
FStateTreeBlueprintPropertyInfo() = default;
FStateTreeBlueprintPropertyInfo(const FName InPropertyName, const EStateTreeBlueprintPropertyCategory InCategory)
: PropertyName(InPropertyName), Category(InCategory)
{}
UPROPERTY()
FName PropertyName;
UPROPERTY()
EStateTreeBlueprintPropertyCategory Category = EStateTreeBlueprintPropertyCategory::NotSet;
};
/** Struct use to copy external data to the Blueprint item instance, resolved during StateTree linking. */
struct STATETREEMODULE_API FStateTreeBlueprintExternalDataHandle
{
const FProperty* Property = nullptr;
FStateTreeExternalDataHandle Handle;
};
UCLASS(Abstract)
class STATETREEMODULE_API UStateTreeItemBlueprintBase : public UObject
{
GENERATED_BODY()
public:
/** Called during link to collect external data handles. */
void LinkExternalData(FStateTreeLinker& Linker, TArray<FStateTreeBlueprintExternalDataHandle>& OutExternalDataHandles) const;
/** Called before call to logic functions to copy data from */
void CopyExternalData(FStateTreeExecutionContext& Context, TConstArrayView<FStateTreeBlueprintExternalDataHandle> ExternalDataHandles);
protected:
virtual UWorld* GetWorld() const override;
AActor* GetOwnerActor(const FStateTreeExecutionContext& Context) const;
#if WITH_EDITOR
virtual void PostCDOCompiled(const FPostCDOCompiledContext& Context) override;
#endif
/** Metadata for properties */
UPROPERTY()
TArray<FStateTreeBlueprintPropertyInfo> PropertyInfos;
};