2021-09-28 13:33:17 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2022-02-03 09:13:49 -05:00
|
|
|
#include "StateTreeNodeBase.h"
|
2021-09-28 13:33:17 -04:00
|
|
|
#include "StateTreeEvaluatorBase.generated.h"
|
|
|
|
|
|
|
|
|
|
struct FStateTreeExecutionContext;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Base struct of StateTree Evaluators.
|
|
|
|
|
* Evaluators calculate and expose data to be used for decision making in a StateTree.
|
|
|
|
|
*/
|
2022-05-18 02:35:34 -04:00
|
|
|
USTRUCT(meta = (Hidden))
|
2022-02-03 09:13:49 -05:00
|
|
|
struct STATETREEMODULE_API FStateTreeEvaluatorBase : public FStateTreeNodeBase
|
2021-09-28 13:33:17 -04:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
2022-05-16 05:13:27 -04:00
|
|
|
|
2021-09-28 13:33:17 -04:00
|
|
|
/**
|
2022-05-16 05:13:27 -04:00
|
|
|
* Called when StateTree is started.
|
|
|
|
|
* @param Context Reference to current execution context.
|
|
|
|
|
*/
|
|
|
|
|
virtual void TreeStart(FStateTreeExecutionContext& Context) const {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called when StateTree is stopped.
|
|
|
|
|
* @param Context Reference to current execution context.
|
|
|
|
|
*/
|
|
|
|
|
virtual void TreeStop(FStateTreeExecutionContext& Context) const {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called each frame to update the evaluator.
|
2021-09-28 13:33:17 -04:00
|
|
|
* @param Context Reference to current execution context.
|
|
|
|
|
* @param DeltaTime Time since last StateTree tick, or 0 if called during preselection.
|
|
|
|
|
*/
|
2022-09-29 20:26:53 -04:00
|
|
|
virtual void Tick(FStateTreeExecutionContext& Context, const float DeltaTime) const {}
|
2021-09-28 13:33:17 -04:00
|
|
|
|
|
|
|
|
#if WITH_GAMEPLAY_DEBUGGER
|
|
|
|
|
virtual void AppendDebugInfoString(FString& DebugString, const FStateTreeExecutionContext& Context) const;
|
|
|
|
|
#endif // WITH_GAMEPLAY_DEBUGGER
|
|
|
|
|
};
|
2021-12-09 05:38:26 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Base class (namespace) for all common Evaluators that are generally applicable.
|
|
|
|
|
* This allows schemas to safely include all Evaluators child of this struct.
|
|
|
|
|
*/
|
|
|
|
|
USTRUCT(Meta=(Hidden))
|
|
|
|
|
struct STATETREEMODULE_API FStateTreeEvaluatorCommonBase : public FStateTreeEvaluatorBase
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
2023-01-25 02:42:36 -05:00
|
|
|
};
|