// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Subsystems/GameInstanceSubsystem.h" #include "StateMachineSubsystem.generated.h" UENUM(BlueprintType) enum class EGameState : uint8 { MainMenu, Battle, BattleMenu, GameOver, Victory }; DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FStateChangedDelegate, EGameState, NewState); /** * */ UCLASS() class SPACEBATTLER_API UStateMachineSubsystem : public UGameInstanceSubsystem { GENERATED_BODY() public: virtual void Initialize(FSubsystemCollectionBase& Collection) override; UFUNCTION(BlueprintCallable) bool ChangeState(EGameState NewState); UPROPERTY(BlueprintAssignable) FStateChangedDelegate StateChangedDelegate; protected: EGameState CurrentState; };