Interface IGameData
Interface for an object that can be loaded as a Socially Distant game session.
Namespace: SociallyDistant.Core.Modules
Assembly: SociallyDistant.Framework.dll
Syntax
public interface IGameData : IGameContent
Properties
LocalFilePath
Gets a value indicating where the save file is stored on disk. Should be the base directory, and can be null. If null, local data storage isn't supported by this save type.
Declaration
string? LocalFilePath { get; }
Property Value
Type | Description |
---|---|
string |
PlayerInfo
Gets or sets information about the player character, usually stored as the save file's header.
Declaration
PlayerInfo PlayerInfo { get; }
Property Value
Type | Description |
---|---|
PlayerInfo |
Methods
CreateRestorePoint(string)
Creates a new restore point based on the contents of the save file, overwriting previous restore points on disk.
Declaration
Task<IGameRestorePoint?> CreateRestorePoint(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the new restore point. |
Returns
Type | Description |
---|---|
Task<IGameRestorePoint> | A task that completes when the restore point has been created. |
ExtractWorldData(Stream)
Extracts world data from the save file into the specified stream.
Declaration
Task<bool> ExtractWorldData(Stream destinationStream)
Parameters
Type | Name | Description |
---|---|---|
Stream | destinationStream | The stream to which uncompressed, serialized world data will be copied. |
Returns
Type | Description |
---|---|
Task<bool> | A task that completes when world data has been decompressed and copied. |
GetPlayerAvatar()
Loads the player avatar image from the saved data.
Declaration
Task<Texture2D> GetPlayerAvatar()
Returns
Type | Description |
---|---|
Task<Texture2D> | A task that completes when loading has finished. |
GetPlayerCoverPhoto()
Unused. For now.
Declaration
Task<Texture2D> GetPlayerCoverPhoto()
Returns
Type | Description |
---|---|
Task<Texture2D> |
SaveWorld(IWorldManager)
Serialize and save the contents of the given world to the save file.
Declaration
Task SaveWorld(IWorldManager world)
Parameters
Type | Name | Description |
---|---|---|
IWorldManager | world |
Returns
Type | Description |
---|---|
Task |
UpdatePlayerInfo(PlayerInfo)
Modify the player information of the save and write it to disk.
Declaration
Task UpdatePlayerInfo(PlayerInfo newPlayerInfo)
Parameters
Type | Name | Description |
---|---|---|
PlayerInfo | newPlayerInfo |
Returns
Type | Description |
---|---|
Task |