// 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; } enum class EStateTreeTraceInstanceEventType : uint8; class UStateTree; class FStateTreeTraceProvider : public IStateTreeTraceProvider { public: static FName ProviderName; explicit FStateTreeTraceProvider(TraceServices::IAnalysisSession& InSession); void AppendEvent(FStateTreeInstanceDebugId InInstanceId, double InTime, const FStateTreeTraceEventVariantType& Event); void AppendInstance( const UStateTree* InStateTree, const FStateTreeInstanceDebugId InInstanceId, const TCHAR* InInstanceName, const EStateTreeTraceInstanceEventType EventType); protected: /** IStateTreeDebuggerProvider interface */ virtual void GetActiveInstances(TArray& OutInstances) const override; virtual bool ReadTimelines(const FStateTreeInstanceDebugId InstanceId, TFunctionRef Callback) const override; private: TraceServices::IAnalysisSession& Session; TArray ActiveInstances; TMap InstanceIdToDebuggerEntryTimelines; TArray>> EventsTimelines; }; #endif // WITH_STATETREE_DEBUGGER