Class Savegames
- Namespace
- FrameOfReference
- Assembly
- FrameOfReference.dll
Saving and loading Sessions as named savegames.
public class Savegames
- Inheritance
-
objectSavegames
Constructors
Savegames(Game, Session?, Action?)
Saving and loading Sessions as named savegames.
public Savegames(Game game, Session? session = null, Action? beforeSave = null)
Parameters
gameGameThe game instance.
sessionSessionThe currently active session, if any.
beforeSaveActionCalled before saving, e.g. to sync presenter state back to the session.
Methods
Delete(string)
Deletes the savegame saved under the specified name, if there is one.
[UsedImplicitly]
public void Delete(string name)
Parameters
namestring
GetNames()
Returns the names of all user-created savegames, excluding the auto-resume slot.
[UsedImplicitly]
public IEnumerable<string> GetNames()
Returns
Load(string)
Loads the session saved under the specified name and activates it.
[UsedImplicitly]
public void Load(string name)
Parameters
namestring
Exceptions
- IOException
A problem occurred while reading the file.
- UnauthorizedAccessException
Read access to the file is not permitted.
- InvalidOperationException
A problem occurred while deserializing the XML data.
Save(string)
Saves the currently active session under the specified name.
[UsedImplicitly]
public void Save(string name)
Parameters
namestring
Exceptions
- IOException
A problem occurred while writing the file.
- UnauthorizedAccessException
Write access to the file is not permitted.