2021-09-28 13:33:17 -04:00
// Copyright Epic Games, Inc. All Rights Reserved.
# pragma once
2024-05-15 14:50:35 -04:00
# include "HAL/IConsoleManager.h"
2021-09-28 13:33:17 -04:00
# include "StateTreeSchema.generated.h"
2023-01-25 02:42:36 -05:00
struct FStateTreeExternalDataDesc ;
2021-09-28 13:33:17 -04:00
/**
* 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 */
2021-11-24 04:26:12 -05:00
virtual bool IsStructAllowed ( const UScriptStruct * InScriptStruct ) const { return false ; }
/** @return True if specified class is supported */
2022-04-04 13:53:17 -04:00
virtual bool IsClassAllowed ( const UClass * InScriptStruct ) const { return false ; }
2021-09-28 13:33:17 -04:00
2021-11-12 05:48:11 -05:00
/** @return True if specified struct/class is supported as external data */
2022-04-04 13:53:17 -04:00
virtual bool IsExternalItemAllowed ( const UStruct & InStruct ) const { return false ; }
2021-11-24 04:26:12 -05:00
/**
* 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 ;
2021-12-08 03:29:30 -05:00
2022-09-19 19:47:11 -04:00
/** @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 { } ; }
2022-04-12 15:55:39 -04:00
2021-12-08 03:29:30 -05:00
# if WITH_EDITOR
/** @return True if enter conditions are allowed. */
virtual bool AllowEnterConditions ( ) const { return true ; }
2024-05-15 14:50:35 -04:00
/** @return True if utility considerations are allowed. */
virtual bool AllowUtilityConsiderations ( ) const { return true ; }
2021-12-08 03:29:30 -05:00
/** @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
2021-09-28 13:33:17 -04:00
} ;
2023-01-25 02:42:36 -05:00
# if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_2
# include "StateTreeTypes.h"
# endif