Files
UnrealEngineUWP/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/StateTreeSchema.h
henrik karlsson 9a1d5b1ad4 [Engine/Plugins]
* Ran IWYU on ~170 plugins to remove includes not needed. Public api still keep old includes inside #if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2

#preflight 63d09351574ab9cae4670216
#rb none

[CL 23844750 by henrik karlsson in ue5-main branch]
2023-01-25 02:42:36 -05:00

61 lines
2.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "StateTreeSchema.generated.h"
struct FStateTreeExternalDataDesc;
/**
* Schema describing which inputs, evaluators, and tasks a StateTree can contain.
* Each StateTree asset saves the schema class name in asset data tags, which can be
* used to limit which StatTree assets can be selected per use case, i.e.:
*
* UPROPERTY(EditDefaultsOnly, Category = AI, meta=(RequiredAssetDataTags="Schema=StateTreeSchema_SupaDupa"))
* UStateTree* StateTree;
*
*/
UCLASS(Abstract)
class STATETREEMODULE_API UStateTreeSchema : public UObject
{
GENERATED_BODY()
public:
/** @return True if specified struct is supported */
virtual bool IsStructAllowed(const UScriptStruct* InScriptStruct) const { return false; }
/** @return True if specified class is supported */
virtual bool IsClassAllowed(const UClass* InScriptStruct) const { return false; }
/** @return True if specified struct/class is supported as external data */
virtual bool IsExternalItemAllowed(const UStruct& InStruct) const { return false; }
/**
* Helper function to check if a class is any of the Blueprint extendable item classes (Eval, Task, Condition).
* Can be used to quickly accept all of those classes in IsClassAllowed().
* @return True if the class is a StateTree item Blueprint base class.
*/
bool IsChildOfBlueprintBase(const UClass* InClass) const;
/** @return List of context objects (UObjects or UScriptStructs) enforced by the schema. They must be provided at runtime through the execution context. */
virtual TConstArrayView<FStateTreeExternalDataDesc> GetContextDataDescs() const { return {}; }
#if WITH_EDITOR
/** @return True if enter conditions are allowed. */
virtual bool AllowEnterConditions() const { return true; }
/** @return True if evaluators are allowed. */
virtual bool AllowEvaluators() const { return true; }
/** @return True if multiple tasks are allowed. */
virtual bool AllowMultipleTasks() const { return true; }
#endif // WITH_EDITOR
};
#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2
#include "StateTreeTypes.h"
#endif