Class Game
- Namespace
- FrameOfReference
- Assembly
- FrameOfReference.dll
Represents a running instance of the game
public class Game : GameBase, IRenderHost, IDisposable
- Inheritance
-
objectGame
- Implements
- Inherited Members
Constructors
Game(Settings)
Represents a running instance of the game
public Game(Settings settings)
Parameters
settingsSettings
Methods
ApplyGeneralSettings()
Called when Changed.
protected override void ApplyGeneralSettings()
Dispose(bool)
To be called by Dispose() and the object destructor.
protected override void Dispose(bool disposing)
Parameters
disposingbooltrueif called manually and not by the garbage collector.
GetElapsedGameTime(double)
Determines the amount of elapsed game time from the amount of elapsed real time.
protected override double GetElapsedGameTime(double elapsedTime)
Parameters
elapsedTimedouble
Returns
GetSavegameNames()
Lists the names of all stored Sessions.
[UsedImplicitly]
public IEnumerable<string> GetSavegameNames()
Returns
Initialize()
To be called after the window is ready and the Engine needs to be set up
protected override bool Initialize()
Returns
- bool
trueif the initialization worked,falseif it failed and the app must be closed
LoadMap(string)
Loads a game map into FrameOfReference.Game._currentSession and switches to InGame
[UsedImplicitly]
public void LoadMap(string name)
Parameters
namestringThe name of the map to load
LoadMenu(string)
Loads a map into FrameOfReference.Game._menuUniverse and switches to Menu
[UsedImplicitly]
public void LoadMenu(string name)
Parameters
namestringThe name of the map to load
LoadSavegame(string)
Loads a savegame from user's profile to replace the FrameOfReference.Game._currentSession.
[UsedImplicitly]
public void LoadSavegame(string name)
Parameters
namestringThe name of the savegame to load.
ModifyMap(string)
Loads a game map into FrameOfReference.Game._currentSession and switches the FrameOfReference.Game._currentState to Modify
[UsedImplicitly]
public void ModifyMap(string name)
Parameters
namestringThe name of the map to load
NewLua()
Creates a new LuaInterface.Lua instance with commonly used objects preloaded.
[LuaHide]
public override Lua NewLua()
Returns
- Lua
Run()
Shows the window and runs the render loop until Exit() is called.
[LuaHide]
public override void Run()
SaveSavegame(string)
Saves the FrameOfReference.Game._currentSession as a savegame stored in the user's profile.
[UsedImplicitly]
public void SaveSavegame(string name)
Parameters
namestringThe name of the savegame to write.
SwitchToGame()
Switches the game to in-game mode
[UsedImplicitly]
public void SwitchToGame()
Remarks
Loading may take a while, subsequent calls will be a bit faster because the Engine cache will still be hot.
SwitchToMenu()
Switches to the main menu
[UsedImplicitly]
public void SwitchToMenu()
Remarks
Loading will take a while on first call, subsequent calls will be very fast, because FrameOfReference.Game._menuUniverse is preserved
SwitchToModify()
Switches the game to map modification mode
[UsedImplicitly]
public void SwitchToModify()
Remarks
Loading may take a while, subsequent calls will be a bit faster because the Engine cache will still be hot.
TogglePause()
[UsedImplicitly]
public void TogglePause()