#pragma once

#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "HyperTwistSimulation/HyperTwistVirtual3333ProjectionLibrary.h"
#include "HyperTwistVirtual3333ProjectionGameMode.generated.h"

class AHyperTwistVirtual3333ProjectionActor;
class AHyperTwistVirtual3333ProjectionOrbitPawn;
class AHyperTwistVirtual3333ProjectionPlayerController;

UCLASS(BlueprintType, Blueprintable)
class UNREALHYPERTWIST_API AHyperTwistVirtual3333ProjectionGameMode : public AGameModeBase
{
	GENERATED_BODY()

public:
	AHyperTwistVirtual3333ProjectionGameMode();

	virtual void BeginPlay() override;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist|Virtual3333")
	bool bAutoSpawnProjectionActor = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist|Virtual3333")
	int32 PuzzleOrder = 3;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist|Virtual3333")
	TSubclassOf<AHyperTwistVirtual3333ProjectionActor> ProjectionActorClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist|Virtual3333")
	FVector ProjectionSpawnLocation = FVector(0.0f, 0.0f, 160.0f);

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist|Virtual3333")
	FRotator ProjectionSpawnRotation = FRotator::ZeroRotator;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist|Virtual3333")
	EHyperTwistVirtual3333Axis StartupSliceAxis = EHyperTwistVirtual3333Axis::W;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist|Virtual3333")
	int32 StartupSliceCoordinate = 1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist|Virtual3333")
	EHyperTwistVirtual3333Axis StartupRotationAxis = EHyperTwistVirtual3333Axis::X;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist|Virtual3333|Persistence")
	bool bLoadSavedStateOnBeginPlay = true;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "HyperTwist|Virtual3333")
	TObjectPtr<AHyperTwistVirtual3333ProjectionActor> ActiveProjectionActor = nullptr;

	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Virtual3333")
	void ResetProjectionToSolved();

protected:
	AHyperTwistVirtual3333ProjectionActor* ResolveOrSpawnProjectionActor();
};

UCLASS()
class UNREALHYPERTWIST_API AHyperTwistVirtual4444ProjectionGameMode
	: public AHyperTwistVirtual3333ProjectionGameMode
{
	GENERATED_BODY()

public:
	AHyperTwistVirtual4444ProjectionGameMode();
};

UCLASS()
class UNREALHYPERTWIST_API AHyperTwistVirtual5555ProjectionGameMode
	: public AHyperTwistVirtual3333ProjectionGameMode
{
	GENERATED_BODY()

public:
	AHyperTwistVirtual5555ProjectionGameMode();
};

UCLASS()
class UNREALHYPERTWIST_API AHyperTwistVirtual6666ProjectionGameMode
	: public AHyperTwistVirtual3333ProjectionGameMode
{
	GENERATED_BODY()

public:
	AHyperTwistVirtual6666ProjectionGameMode();
};
