#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "HyperTwistReplay/HyperTwistReplayTypes.h"
#include "HyperTwistReplayPersistenceLibrary.generated.h"

UCLASS()
class UNREALHYPERTWIST_API UHyperTwistReplayPersistenceLibrary : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

public:
	UFUNCTION(BlueprintPure, Category = "HyperTwist|Replay|Persistence")
	static FString GetDefaultReplayDirectory();

	UFUNCTION(BlueprintPure, Category = "HyperTwist|Replay|Persistence")
	static FHyperTwistReplayPacket NormalizeReplayPacket(
		const FHyperTwistReplayPacket& ReplayPacket
	);

	UFUNCTION(BlueprintPure, Category = "HyperTwist|Replay|Persistence")
	static FString GetDefaultReplayPath(const FHyperTwistReplayPacket& ReplayPacket);

	UFUNCTION(BlueprintPure, Category = "HyperTwist|Replay|Persistence")
	static FString ResolveReplayPacketPath(
		const FHyperTwistReplayPacket& ReplayPacket,
		const FString& ReplayPath
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Replay|Persistence")
	static bool SaveReplayPacketToFile(
		const FHyperTwistReplayPacket& ReplayPacket,
		const FString& ReplayPath,
		FString& OutResolvedPath
	);

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Replay|Persistence")
	static bool LoadReplayPacketFromFile(
		const FString& ReplayPath,
		FHyperTwistReplayPacket& OutReplayPacket,
		FString& OutResolvedPath
	);
};
