Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/StateTreeConditionBase.h
jacob wang c7a6fe6ffa [State Tree] Renaming common elements between Condition and the upcoming Utility Consideration
- Renamed EStateTreeConditionOperand and properties of that type.
- Renamed FStateTreeEditorNode::Indent Property.
- Corrected a few tooltips
#rb mikko.mononen, Yoan.StAmant

[CL 33614033 by jacob wang in ue5-main branch]
2024-05-13 20:48:39 -04:00

65 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "StateTreeNodeBase.h"
#include "StateTreeExecutionTypes.h"
#include "StateTreeConditionBase.generated.h"
struct FStateTreeExecutionContext;
enum class EStateTreeCompare : uint8
{
Default,
Invert,
};
/**
* Base struct for all conditions.
*/
USTRUCT(meta = (Hidden))
struct STATETREEMODULE_API FStateTreeConditionBase : public FStateTreeNodeBase
{
GENERATED_BODY()
/** @return True if the condition passes. */
virtual bool TestCondition(FStateTreeExecutionContext& Context) const { return false; }
UPROPERTY()
EStateTreeExpressionOperand Operand = EStateTreeExpressionOperand::And;
UPROPERTY()
int8 DeltaIndent = 0;
UPROPERTY()
EStateTreeConditionEvaluationMode EvaluationMode = EStateTreeConditionEvaluationMode::Evaluated;
};
/**
* Base class (namespace) for all common Conditions that are generally applicable.
* This allows schemas to safely include all conditions child of this struct.
*/
USTRUCT(meta = (Hidden))
struct STATETREEMODULE_API FStateTreeConditionCommonBase : public FStateTreeConditionBase
{
GENERATED_BODY()
};
/** Helper macro to define instance data as simple constructible. */
#define STATETREE_POD_INSTANCEDATA(Type) \
template <> struct TIsPODType<Type> { enum { Value = true }; }; \
template<> \
struct TStructOpsTypeTraits<Type> : public TStructOpsTypeTraitsBase2<Type> \
{ \
enum \
{ \
WithZeroConstructor = true, \
WithNoDestructor = true, \
}; \
};
#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2
#include "StateTreeExecutionContext.h"
#include "StateTreePropertyBindings.h"
#endif