Endstar LUA API Documentation
Loading...
Searching...
No Matches
Game Class Reference

Allows you to access information about the current session including players, level, and game info. More...

Public Member Functions

 Game ()
 
int GetPlayerCount ()
 How many players are currently connected?
 
Context GetPlayerByIndex (int playerIndex)
 Get a player by index. This starts at 0, and will have no gaps. Easy to use with GetPlayerCount.
 
Context GetPlayerBySlot (int playerSlot)
 Returns the player's context currently in the requested slot. Note that if players have left there may be gaps in the slots, and that slots start at 1. The slot number is the same number you see displayed with the player name + hearts.
 
Context[] GetPlayers ()
 Get all the currently connected player's contexts!
 
string GetGameTitle ()
 
string GetGameDescription ()
 
string GetLevelName ()
 Gets the name of the currently loaded level.
 
string GetLevelDescription ()
 Gets the description of the currently loaded level.
 
int GetMinPlayerCount ()
 Gets the minimum number of players required to play this game. Currently unused, but will eventually be searchable and enforceable.
 
int GetMaxPlayerCount ()
 Gets the maximum number of players allowed to play this game. Currently unused, but will eventually be searchable and enforceable.
 

Public Attributes

LuaInterfaceEvent OnPlayerCountChanged = new()
 
LuaInterfaceEvent OnPlayerLeft = new()
 
LuaInterfaceEvent OnPlayerJoined = new()
 

Detailed Description

Allows you to access information about the current session including players, level, and game info.

Constructor & Destructor Documentation

◆ Game()

Game ( )

Member Function Documentation

◆ GetGameDescription()

string GetGameDescription ( )

◆ GetGameTitle()

string GetGameTitle ( )

◆ GetLevelDescription()

string GetLevelDescription ( )

Gets the description of the currently loaded level.

Returns

◆ GetLevelName()

string GetLevelName ( )

Gets the name of the currently loaded level.

Returns

◆ GetMaxPlayerCount()

int GetMaxPlayerCount ( )

Gets the maximum number of players allowed to play this game. Currently unused, but will eventually be searchable and enforceable.

Returns

◆ GetMinPlayerCount()

int GetMinPlayerCount ( )

Gets the minimum number of players required to play this game. Currently unused, but will eventually be searchable and enforceable.

Returns

◆ GetPlayerByIndex()

Context GetPlayerByIndex ( int playerIndex)

Get a player by index. This starts at 0, and will have no gaps. Easy to use with GetPlayerCount.

Parameters
playerIndex
Returns
Nil if invalid index

◆ GetPlayerBySlot()

Context GetPlayerBySlot ( int playerSlot)

Returns the player's context currently in the requested slot. Note that if players have left there may be gaps in the slots, and that slots start at 1. The slot number is the same number you see displayed with the player name + hearts.

Parameters
playerSlot
Returns

◆ GetPlayerCount()

int GetPlayerCount ( )

How many players are currently connected?

Returns

◆ GetPlayers()

Context[] GetPlayers ( )

Get all the currently connected player's contexts!

Returns

Member Data Documentation

◆ OnPlayerCountChanged

LuaInterfaceEvent OnPlayerCountChanged = new()

◆ OnPlayerJoined

LuaInterfaceEvent OnPlayerJoined = new()

◆ OnPlayerLeft

LuaInterfaceEvent OnPlayerLeft = new()