Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/Blueprint/StateTreeConditionBlueprintBase.h
mikko mononen 1e28b99891 StateTree: Condition expressions
#jira UE-146925
#review-19478890
- Added ability to combine conditions into expressions
- Added editor UI for the expressions
- Replaced condition description with a name (makes the expressions faster to skim)
#preflight 62417309361866e20ffa6320

[CL 19524558 by mikko mononen in ue5-main branch]
2022-03-28 04:48:50 -04:00

47 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Templates/SubclassOf.h"
#include "StateTreeTypes.h"
#include "StateTreeConditionBase.h"
#include "StateTreePropertyBindings.h"
#include "StateTreeItemBlueprintBase.h"
#include "StateTreeConditionBlueprintBase.generated.h"
struct FStateTreeExecutionContext;
/*
* Base class for Blueprint based Conditions.
*/
UCLASS(Abstract, Blueprintable)
class STATETREEMODULE_API UStateTreeConditionBlueprintBase : public UStateTreeItemBlueprintBase
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintImplementableEvent)
bool ReceiveTestCondition(AActor* OwnerActor);
virtual bool TestCondition(FStateTreeExecutionContext& Context);
};
/**
* Wrapper for Blueprint based Conditions.
*/
USTRUCT()
struct STATETREEMODULE_API FStateTreeBlueprintConditionWrapper : public FStateTreeConditionBase
{
GENERATED_BODY()
virtual const UStruct* GetInstanceDataType() const override { return ConditionClass; };
virtual bool Link(FStateTreeLinker& Linker) override;
virtual bool TestCondition(FStateTreeExecutionContext& Context) const override;
UPROPERTY()
TSubclassOf<UStateTreeConditionBlueprintBase> ConditionClass = nullptr;
TArray<FStateTreeBlueprintExternalDataHandle> ExternalDataHandles;
};