Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/Blueprint/StateTreeConsiderationBlueprintBase.h
jacob wang d0a9f7e6de [State Tree] Utility Selector Editor Representation First Pass
- Editor View and Operations(debugger support not yet)
- Basic Utility Consideration Base
- Built-in Float Parameter Consideration
- Basic Blueprint Support
#rb mikko.mononen

[CL 33665793 by jacob wang in ue5-main branch]
2024-05-15 14:50:35 -04:00

60 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "StateTreeConsiderationBase.h"
#include "StateTreeNodeBlueprintBase.h"
#include "Templates/SubclassOf.h"
#include "StateTreeConsiderationBlueprintBase.generated.h"
struct FStateTreeExecutionContext;
/*
* Base class for Blueprint based Considerations.
*/
UCLASS(Abstract, Blueprintable)
class STATETREEMODULE_API UStateTreeConsiderationBlueprintBase : public UStateTreeNodeBlueprintBase
{
GENERATED_BODY()
public:
UStateTreeConsiderationBlueprintBase(const FObjectInitializer& ObjectInitializer);
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "ComputeRawScore"))
float ReceiveComputeRawScore() const;
protected:
virtual float ComputeRawScore(FStateTreeExecutionContext& Context) const;
friend struct FStateTreeBlueprintConsiderationWrapper;
uint8 bHasComputeRawScore : 1;
};
/**
* Wrapper for Blueprint based Considerations.
*/
USTRUCT()
struct STATETREEMODULE_API FStateTreeBlueprintConsiderationWrapper : public FStateTreeConsiderationBase
{
GENERATED_BODY()
//~ Begin FStateTreeNodeBase Interface
virtual const UStruct* GetInstanceDataType() const override { return ConsiderationClass; };
#if WITH_EDITOR
virtual FText GetDescription(const FGuid& ID, FStateTreeDataView InstanceDataView, const IStateTreeBindingLookup& BindingLookup, EStateTreeNodeFormatting Formatting = EStateTreeNodeFormatting::Text) const override;
virtual FName GetIconName() const override;
virtual FColor GetIconColor() const override;
#endif //WITH_EDITOR
//~ End FStateTreeNodeBase Interface
protected:
//~ Begin FStateTreeConsiderationBase Interface
virtual float ComputeRawScore(FStateTreeExecutionContext& Context) const override;
//~ End FStateTreeConsiderationBase Interface
public:
UPROPERTY()
TSubclassOf<UStateTreeConsiderationBlueprintBase> ConsiderationClass = nullptr;
};