UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ISaveGameSystem Class Referenceabstract

#include <SaveGameSystem.h>

+ Inheritance diagram for ISaveGameSystem:

Public Types

enum class  ESaveExistsResult { OK , DoesNotExist , Corrupt , UnspecifiedError }
 
typedef TFunction< void(const FString &, FPlatformUserId, bool)> FSaveGameAsyncOpCompleteCallback
 
typedef TFunction< void(const FString &, FPlatformUserId, bool, const TArray< uint8 > &)> FSaveGameAsyncLoadCompleteCallback
 
typedef TFunction< void(const FString &, FPlatformUserId, ISaveGameSystem::ESaveExistsResult)> FSaveGameAsyncExistsCallback
 
typedef TFunction< void(FPlatformUserId, bool)> FSaveGameAsyncInitCompleteCallback
 
typedef TFunction< void(FPlatformUserId, bool, const TArray< FString > &)> FSaveGameAsyncGetNamesCallback
 

Public Member Functions

virtual bool PlatformHasNativeUI ()=0
 
virtual bool DoesSaveSystemSupportMultipleUsers ()=0
 
virtual bool DoesSaveGameExist (const TCHAR *Name, const int32 UserIndex)=0
 
virtual ESaveExistsResult DoesSaveGameExistWithResult (const TCHAR *Name, const int32 UserIndex)=0
 
virtual bool GetSaveGameNames (TArray< FString > &FoundSaves, const int32 UserIndex)
 
virtual bool SaveGame (bool bAttemptToUseUI, const TCHAR *Name, const int32 UserIndex, const TArray< uint8 > &Data)=0
 
virtual bool LoadGame (bool bAttemptToUseUI, const TCHAR *Name, const int32 UserIndex, TArray< uint8 > &Data)=0
 
virtual bool DeleteGame (bool bAttemptToUseUI, const TCHAR *Name, const int32 UserIndex)=0
 
virtual ENGINE_API void DoesSaveGameExistAsync (const TCHAR *Name, FPlatformUserId PlatformUserId, FSaveGameAsyncExistsCallback Callback)
 
virtual ENGINE_API void SaveGameAsync (bool bAttemptToUseUI, const TCHAR *Name, FPlatformUserId PlatformUserId, TSharedRef< const TArray< uint8 > > Data, FSaveGameAsyncOpCompleteCallback Callback)
 
virtual ENGINE_API void LoadGameAsync (bool bAttemptToUseUI, const TCHAR *Name, FPlatformUserId PlatformUserId, FSaveGameAsyncLoadCompleteCallback Callback)
 
virtual ENGINE_API void LoadGameIfExistsAsync (bool bAttemptToUseUI, const TCHAR *Name, FPlatformUserId PlatformUserId, FSaveGameAsyncLoadCompleteCallback Callback)
 
virtual ENGINE_API void DeleteGameAsync (bool bAttemptToUseUI, const TCHAR *Name, FPlatformUserId PlatformUserId, FSaveGameAsyncOpCompleteCallback Callback)
 
virtual ENGINE_API void GetSaveGameNamesAsync (FPlatformUserId PlatformUserId, FSaveGameAsyncGetNamesCallback Callback)
 
virtual ENGINE_API void InitAsync (bool bAttemptToUseUI, FPlatformUserId PlatformUserId, FSaveGameAsyncInitCompleteCallback Callback)
 

Protected Member Functions

ENGINE_API void OnAsyncComplete (TFunction< void()> Callback)
 

Static Protected Attributes

static ENGINE_API UE::Tasks::FPipe AsyncTaskPipe { TEXT("SaveGamePipe") }
 

Detailed Description

Interface for platform feature modules Defines the interface to platform's save game system (or a generic file based one)

Member Typedef Documentation

◆ FSaveGameAsyncExistsCallback

◆ FSaveGameAsyncGetNamesCallback

◆ FSaveGameAsyncInitCompleteCallback

◆ FSaveGameAsyncLoadCompleteCallback

◆ FSaveGameAsyncOpCompleteCallback

Member Enumeration Documentation

◆ ESaveExistsResult

Enumerator
OK 
DoesNotExist 
Corrupt 
UnspecifiedError 

Member Function Documentation

◆ DeleteGame()

virtual bool ISaveGameSystem::DeleteGame ( bool  bAttemptToUseUI,
const TCHAR Name,
const int32  UserIndex 
)
pure virtual

Delete an existing save game, blocking until complete

Implemented in FGenericSaveGameSystem, FBaseAsyncSaveGameSystem, and FIOSSaveGameSystem.

◆ DeleteGameAsync()

void ISaveGameSystem::DeleteGameAsync ( bool  bAttemptToUseUI,
const TCHAR Name,
FPlatformUserId  PlatformUserId,
FSaveGameAsyncOpCompleteCallback  Callback 
)
virtual

Reimplemented in FBaseAsyncSaveGameSystem.

◆ DoesSaveGameExist()

virtual bool ISaveGameSystem::DoesSaveGameExist ( const TCHAR Name,
const int32  UserIndex 
)
pure virtual

Return true if the named savegame exists (probably not useful with NativeUI

Implemented in FGenericSaveGameSystem, FBaseAsyncSaveGameSystem, and FIOSSaveGameSystem.

◆ DoesSaveGameExistAsync()

void ISaveGameSystem::DoesSaveGameExistAsync ( const TCHAR Name,
FPlatformUserId  PlatformUserId,
FSaveGameAsyncExistsCallback  Callback 
)
virtual

Reimplemented in FBaseAsyncSaveGameSystem.

◆ DoesSaveGameExistWithResult()

virtual ESaveExistsResult ISaveGameSystem::DoesSaveGameExistWithResult ( const TCHAR Name,
const int32  UserIndex 
)
pure virtual

Similar to DoesSaveGameExist, except returns a result code with more information.

Implemented in FGenericSaveGameSystem, FBaseAsyncSaveGameSystem, and FIOSSaveGameSystem.

◆ DoesSaveSystemSupportMultipleUsers()

virtual bool ISaveGameSystem::DoesSaveSystemSupportMultipleUsers ( )
pure virtual

Some save systems don't support more than one user, in those cases the game needs to avoid saving settings for anyone but the primary user.

Implemented in FGenericSaveGameSystem, and FIOSSaveGameSystem.

◆ GetSaveGameNames()

virtual bool ISaveGameSystem::GetSaveGameNames ( TArray< FString > &  FoundSaves,
const int32  UserIndex 
)
inlinevirtual

Gets a list of all known saves. This isn't possible on all platforms.

Reimplemented in FGenericSaveGameSystem, FBaseAsyncSaveGameSystem, and FIOSSaveGameSystem.

◆ GetSaveGameNamesAsync()

void ISaveGameSystem::GetSaveGameNamesAsync ( FPlatformUserId  PlatformUserId,
FSaveGameAsyncGetNamesCallback  Callback 
)
virtual

Reimplemented in FBaseAsyncSaveGameSystem.

◆ InitAsync()

void ISaveGameSystem::InitAsync ( bool  bAttemptToUseUI,
FPlatformUserId  PlatformUserId,
FSaveGameAsyncInitCompleteCallback  Callback 
)
virtual

◆ LoadGame()

virtual bool ISaveGameSystem::LoadGame ( bool  bAttemptToUseUI,
const TCHAR Name,
const int32  UserIndex,
TArray< uint8 > &  Data 
)
pure virtual

Loads the game, blocking until complete

Implemented in FGenericSaveGameSystem, FBaseAsyncSaveGameSystem, and FIOSSaveGameSystem.

◆ LoadGameAsync()

void ISaveGameSystem::LoadGameAsync ( bool  bAttemptToUseUI,
const TCHAR Name,
FPlatformUserId  PlatformUserId,
FSaveGameAsyncLoadCompleteCallback  Callback 
)
virtual

Reimplemented in FBaseAsyncSaveGameSystem.

◆ LoadGameIfExistsAsync()

void ISaveGameSystem::LoadGameIfExistsAsync ( bool  bAttemptToUseUI,
const TCHAR Name,
FPlatformUserId  PlatformUserId,
FSaveGameAsyncLoadCompleteCallback  Callback 
)
virtual

Reimplemented in FBaseAsyncSaveGameSystem.

◆ OnAsyncComplete()

void ISaveGameSystem::OnAsyncComplete ( TFunction< void()>  Callback)
protected

◆ PlatformHasNativeUI()

virtual bool ISaveGameSystem::PlatformHasNativeUI ( )
pure virtual

Returns true if the platform has a native UI (like many consoles)

Implemented in FGenericSaveGameSystem, and FIOSSaveGameSystem.

◆ SaveGame()

virtual bool ISaveGameSystem::SaveGame ( bool  bAttemptToUseUI,
const TCHAR Name,
const int32  UserIndex,
const TArray< uint8 > &  Data 
)
pure virtual

Saves the game, blocking until complete. Platform may use FGameDelegates to get more information from the game

Implemented in FGenericSaveGameSystem, FBaseAsyncSaveGameSystem, and FIOSSaveGameSystem.

◆ SaveGameAsync()

void ISaveGameSystem::SaveGameAsync ( bool  bAttemptToUseUI,
const TCHAR Name,
FPlatformUserId  PlatformUserId,
TSharedRef< const TArray< uint8 > >  Data,
FSaveGameAsyncOpCompleteCallback  Callback 
)
virtual

Reimplemented in FBaseAsyncSaveGameSystem.

Member Data Documentation

◆ AsyncTaskPipe

UE::Tasks::FPipe ISaveGameSystem::AsyncTaskPipe { TEXT("SaveGamePipe") }
staticprotected

The documentation for this class was generated from the following files: