Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/Blueprint/StateTreeConditionBlueprintBase.h
mikko mononen 0d47d49765 StateTree: Context Objects
- Cleaned up Blueprint nodes from deprecated functions
- Added call guards for BP implemented events on BP nodes
- Renamed Named External Data to Context (Object/Data)
- Added automatic binding for Context objects
- Added UI visualization for Context properties and cleaned up the Input/Ouput visualization
- Added compiler errors for missing Input and Context properties

#jira UE-156544 UE-147509
#rb Stephen.Holmes

[CL 22084585 by mikko mononen in ue5-main branch]
2022-09-19 19:47:11 -04:00

48 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Templates/SubclassOf.h"
#include "StateTreeConditionBase.h"
#include "StateTreeNodeBlueprintBase.h"
#include "StateTreeConditionBlueprintBase.generated.h"
struct FStateTreeExecutionContext;
/*
* Base class for Blueprint based Conditions.
*/
UCLASS(Abstract, Blueprintable)
class STATETREEMODULE_API UStateTreeConditionBlueprintBase : public UStateTreeNodeBlueprintBase
{
GENERATED_BODY()
public:
UStateTreeConditionBlueprintBase(const FObjectInitializer& ObjectInitializer);
UFUNCTION(BlueprintImplementableEvent)
bool ReceiveTestCondition() const;
protected:
virtual bool TestCondition(FStateTreeExecutionContext& Context) const;
friend struct FStateTreeBlueprintConditionWrapper;
uint8 bHasTestCondition : 1;
};
/**
* Wrapper for Blueprint based Conditions.
*/
USTRUCT()
struct STATETREEMODULE_API FStateTreeBlueprintConditionWrapper : public FStateTreeConditionBase
{
GENERATED_BODY()
virtual const UStruct* GetInstanceDataType() const override { return ConditionClass; };
virtual bool TestCondition(FStateTreeExecutionContext& Context) const override;
UPROPERTY()
TSubclassOf<UStateTreeConditionBlueprintBase> ConditionClass = nullptr;
};