Class Session
- Namespace
- FrameOfReference.World
- Assembly
- FrameOfReference.World.dll
Represents a game session (i.e. a game actually being played). It is equivalent to the content of a savegame.
public sealed class Session : SessionBase<Universe>
- Inheritance
-
Session
- Inherited Members
- Extension Methods
Constructors
Session()
Base-constructor for XML serialization. Do not call manually!
public Session()
Session(Universe)
Creates a new game session based upon a given Universe.
public Session(Universe baseUniverse)
Parameters
baseUniverse
UniverseThe universe to base the new game session on.
Fields
FileExt
The file extensions when this class is stored as a file.
public const string FileExt = ".FrameOfReferenceSave"
Field Value
Properties
LeftoverGameTime
GameTime time left over from the last Update(double) call due to the fixed update step size.
public double LeftoverGameTime { get; set; }
Property Value
Lua
The scripting engine used to execute story scripts.
public Lua? Lua { get; set; }
Property Value
- Lua
TimeTravelInProgress
Indicates whwther a TimeTravel(double) request is currently being processed.
[Browsable(false)]
public bool TimeTravelInProgress { get; set; }
Property Value
Methods
Load(string)
Loads a Session from an encrypted XML file (savegame).
public static Session Load(string path)
Parameters
path
stringThe file to load from.
Returns
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 this Session in an encrypted XML file (savegame).
public void Save(string path)
Parameters
path
stringThe file to save in.
Exceptions
- IOException
A problem occurred while writing the file.
- UnauthorizedAccessException
Write access to the file is not permitted.
TimeTravel(double)
Like UpdateTo(double), but interpolates between the current and the target time smoothly.
public void TimeTravel(double gameTime)
Parameters
Update(double)
Updates the underlying Universe.
public override double Update(double elapsedRealTime)
Parameters
elapsedRealTime
doubleHow much real time in seconds has elapsed since this method was last called.
Returns
- double
The elapsed game time (real time multiplied by TimeWarpFactor)
UpdateTo(double)
Updates the world to a specific point in game time.
public void UpdateTo(double gameTime)