#pragma once

#include "CoreMinimal.h"
#include "Subsystems/EngineSubsystem.h"
#include "Subsystems/GameInstanceSubsystem.h"
#include "PortaSubsystem.generated.h"

DECLARE_MULTICAST_DELEGATE(FPortaSubsystemTimingDelegate)

UCLASS()
class PORTAINTERFACE_API UPortaControlSubsystem : public UEngineSubsystem
{
	GENERATED_BODY()
public:
	FPortaSubsystemTimingDelegate OnGameInstanceInit;
	FPortaSubsystemTimingDelegate OnGameInstanceDeinit;
};

UCLASS()
class PORTAINTERFACE_API UPortaGISubsystem : public UGameInstanceSubsystem
{
	GENERATED_BODY()
public:
	virtual void Initialize(FSubsystemCollectionBase& Collection) override;
	virtual void Deinitialize() override;

};

UCLASS(Abstract)
class PORTAINTERFACE_API UPortaSubsystem : public UEngineSubsystem
{
	GENERATED_BODY()
public:
	virtual void Initialize(FSubsystemCollectionBase& Collection) override;
	virtual void Deinitialize() override;

	void OnGameStart();
	void OnGameStop();

	virtual void Init() {}
	virtual void Deinit() {}
	virtual void Start() {}
	virtual void Stop() {}
	virtual void OnGameInstanceStart() {}
	virtual UWorld* GetWorld() const override;
};