Class Session
- Namespace
- FrameOfReference.World
- Assembly
- FrameOfReference.World.dll
State of a game session. Corresponds to a savegame.
public sealed class Session : Session<Universe>
- Inheritance
-
objectSession
- Inherited Members
Constructors
Session()
Used for XML serialization. Do not call manually!
[UsedImplicitly]
[Obsolete("Used for XML serialization. Do not call manually!")]
public Session()
Session(Universe)
Creates a new game session.
public Session(Universe universe)
Parameters
universeUniverseContents of the game world.
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 a compressed XML file (savegame).
public static Session Load(string path)
Parameters
pathstringThe 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.
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
elapsedRealTimedoubleHow 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)