Files
UnrealEngineUWP/Engine/Source/Runtime/IOS/IOSPlatformFeatures/Public/IOSSaveGameSystem.h
David Harvey e741cd5dae New save game functions to enumerate save games & deterime if the save interface supports multiple users.
- async enumeration function will be added in a subsequent change.

#rb Nick.Darnell, Brian.White, Jeff.Newquist, Jack.Porter, Nuno.Leiria
#jira UE-143574
#preflight 627929e2822bdc69f00e4a5d

[CL 20119856 by David Harvey in ue5-main branch]
2022-05-10 04:14:32 -04:00

78 lines
2.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "SaveGameSystem.h"
class FIOSSaveGameSystem : public ISaveGameSystem
{
public:
FIOSSaveGameSystem();
virtual ~FIOSSaveGameSystem();
// ISaveGameSystem interface
virtual bool PlatformHasNativeUI() override
{
return false;
}
virtual bool DoesSaveSystemSupportMultipleUsers() override
{
return false;
}
virtual bool GetSaveGameNames(TArray<FString>& FoundSaves, const int32 UserIndex) override;
virtual bool DoesSaveGameExist(const TCHAR* Name, const int32 UserIndex) override
{
return ESaveExistsResult::OK == DoesSaveGameExistWithResult(Name, UserIndex);
}
virtual ESaveExistsResult DoesSaveGameExistWithResult(const TCHAR* Name, const int32 UserIndex) override;
/**
* Called on the initial iCloud sync
*/
virtual bool SaveGameNoCloud(const TCHAR* Name, const TArray<uint8>& Data);
virtual bool SaveGame(bool bAttemptToUseUI, const TCHAR* Name, const int32 UserIndex, const TArray<uint8>& Data) override;
/**
* Called when writing the savegame file
* send the file to iCloud, if enabled
*/
DECLARE_DELEGATE_TwoParams(FOnWriteUserCloudFileBegin, const FString&, const TArray<uint8>&);
FOnWriteUserCloudFileBegin OnWriteUserCloudFileBeginDelegate;
virtual bool LoadGame(bool bAttemptToUseUI, const TCHAR* Name, const int32 UserIndex, TArray<uint8>& Data) override;
/**
* Called when reading the savegame file
* read the file from iCloud, if enabled
*/
DECLARE_DELEGATE_TwoParams(FOnReadUserCloudFileBegin, const FString&, TArray<uint8>&);
FOnReadUserCloudFileBegin OnReadUserCloudFileBeginDelegate;
virtual bool DeleteGame(bool bAttemptToUseUI, const TCHAR* Name, const int32 UserIndex) override;
/**
* Called when deleting the savegame file
* delete the file from iCloud, if enabled
*/
DECLARE_DELEGATE_OneParam(FOnDeleteUserCloudFileBegin, const FString&);
FOnDeleteUserCloudFileBegin OnDeleteUserCloudFileBeginDelegate;
private:
/**
* Initializes the SaveData library then loads and initializes the SaveDialog library
*/
void Initialize();
/**
* Terminates and unloads the SaveDialog library then terminates the SaveData library
*/
void Shutdown();
/**
* Get the path to save game file for the given name
*/
virtual FString GetSaveGamePath(const TCHAR* Name);
};