35 lines
986 B
C++
35 lines
986 B
C++
// Copyright Pacificao. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Subsystems/GameInstanceSubsystem.h"
|
|
#include "AgrarianPersistenceSubsystem.generated.h"
|
|
|
|
class UAgrarianSaveGame;
|
|
|
|
UCLASS()
|
|
class UAgrarianPersistenceSubsystem : public UGameInstanceSubsystem
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Persistence")
|
|
FString DefaultSlotName = TEXT("AgrarianMVP");
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Persistence")
|
|
int32 UserIndex = 0;
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "Agrarian|Persistence")
|
|
UAgrarianSaveGame* CreateEmptySave() const;
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "Agrarian|Persistence")
|
|
UAgrarianSaveGame* LoadOrCreateSave() const;
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "Agrarian|Persistence")
|
|
bool WriteSave(UAgrarianSaveGame* SaveGame) const;
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "Agrarian|Persistence")
|
|
bool DoesSaveExist() const;
|
|
};
|