Table of Contents

Class Game

Namespace
FrameOfReference
Assembly
FrameOfReference.dll

Represents a running instance of the game

public class Game : GameBase, IRenderHost, IDisposable
Inheritance
object
Game
Implements
Inherited Members

Constructors

Game(Settings)

Represents a running instance of the game

public Game(Settings settings)

Parameters

settings Settings

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

disposing bool

true if 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

elapsedTime double

Returns

double

GetSavegameNames()

Lists the names of all stored Sessions.

[UsedImplicitly]
public IEnumerable<string> GetSavegameNames()

Returns

IEnumerable<string>

Initialize()

To be called after the window is ready and the Engine needs to be set up

protected override bool Initialize()

Returns

bool

true if the initialization worked, false if 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

name string

The 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

name string

The 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

name string

The 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

name string

The 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

name string

The 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()

Toggles between InGame and Pause

[UsedImplicitly]
public void TogglePause()