// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #if WITH_STATETREE_DEBUGGER #include "IStateTreeTraceProvider.h" #include "Model/PointTimeline.h" #include "StateTreeTypes.h" // required to compile TMap namespace TraceServices { class IAnalysisSession; } class UStateTree; namespace UE::StateTreeDebugger { struct FInstanceDescriptor; } class FStateTreeTraceProvider : public IStateTreeTraceProvider { public: static FName ProviderName; explicit FStateTreeTraceProvider(TraceServices::IAnalysisSession& InSession); void AppendEvent(FStateTreeInstanceDebugId InInstanceId, double InTime, const FStateTreeTraceEventVariantType& InEvent); void AppendInstanceEvent( const UStateTree* InStateTree, const FStateTreeInstanceDebugId InInstanceId, const TCHAR* InInstanceName, double InTime, double InWorldRecordingTime, EStateTreeTraceEventType InEventType); protected: /** IStateTreeDebuggerProvider interface */ virtual void GetInstances(TArray& OutInstances) const override; virtual bool ReadTimelines(const FStateTreeInstanceDebugId InstanceId, TFunctionRef Callback) const override; virtual bool ReadTimelines(const UStateTree& StateTree, TFunctionRef Callback) const override; private: TraceServices::IAnalysisSession& Session; TMap InstanceIdToDebuggerEntryTimelines; TArray Descriptors; TArray>> EventsTimelines; }; #endif // WITH_STATETREE_DEBUGGER