2021-11-24 10:31:56 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2021-11-24 04:26:29 -05:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2021-11-24 10:31:56 -05:00
|
|
|
#include "Templates/SubclassOf.h"
|
2021-11-24 04:26:29 -05:00
|
|
|
#include "StateTreeConditionBase.h"
|
2022-09-01 09:06:53 -04:00
|
|
|
#include "StateTreeNodeBlueprintBase.h"
|
2021-11-24 04:26:29 -05:00
|
|
|
#include "StateTreeConditionBlueprintBase.generated.h"
|
|
|
|
|
|
|
|
|
|
struct FStateTreeExecutionContext;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Base class for Blueprint based Conditions.
|
|
|
|
|
*/
|
|
|
|
|
UCLASS(Abstract, Blueprintable)
|
2022-09-01 09:06:53 -04:00
|
|
|
class STATETREEMODULE_API UStateTreeConditionBlueprintBase : public UStateTreeNodeBlueprintBase
|
2021-11-24 04:26:29 -05:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
public:
|
2022-09-19 19:47:11 -04:00
|
|
|
UStateTreeConditionBlueprintBase(const FObjectInitializer& ObjectInitializer);
|
2021-11-24 04:26:29 -05:00
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintImplementableEvent)
|
2022-09-19 19:47:11 -04:00
|
|
|
bool ReceiveTestCondition() const;
|
2021-11-24 04:26:29 -05:00
|
|
|
|
2022-09-19 19:47:11 -04:00
|
|
|
protected:
|
2022-05-11 04:04:58 -04:00
|
|
|
virtual bool TestCondition(FStateTreeExecutionContext& Context) const;
|
2022-09-19 19:47:11 -04:00
|
|
|
|
|
|
|
|
friend struct FStateTreeBlueprintConditionWrapper;
|
|
|
|
|
|
|
|
|
|
uint8 bHasTestCondition : 1;
|
2021-11-24 04:26:29 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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;
|
|
|
|
|
};
|
2023-01-25 02:42:36 -05:00
|
|
|
|
|
|
|
|
#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#endif
|