Highroad Engine v1.3
Public Member Functions | Public Attributes | Protected Attributes | Properties | List of all members
MoreMountains.HighroadEngine.LocalLobbyManager Class Reference

This singleton class manages the list of players between races and lobby operations More...

Inheritance diagram for MoreMountains.HighroadEngine.LocalLobbyManager:
MoreMountains.Tools.MMPersistentSingleton< LocalLobbyManager > MoreMountains.HighroadEngine.IGenericLobbyManager

Public Member Functions

void ReturnToLobby ()
 Changes the current scene to the lobby scene. More...
 
virtual void ReturnToStartScreen ()
 Changes the current scene to the start screen. More...
 
virtual void Start ()
 By default, we select the first track More...
 
virtual Dictionary< int, ILobbyPlayerInfoPlayers ()
 Returns the active players list key is index, value is Player data. More...
 
virtual void AddPlayer (LocalLobbyPlayer p)
 Adds the player object to the active players list More...
 
virtual void RemovePlayer (int position)
 Removes the player from active players list More...
 
virtual ILobbyPlayerInfo GetPlayer (int position)
 Gets the player by his position More...
 
virtual bool ContainsPlayer (int position)
 Returns true if a player is already registered for this position. Used when going back to the lobby scene after a game scene. More...
 
virtual int FindFreeVehicle ()
 Finds the next free vehicle index for a player. More...
 
virtual bool IsReadyToPlay ()
 Checks if the players are ready More...
 
virtual int PlayersNotReadyCount ()
 Returns the number of players in lobby that are not ready yet More...
 
virtual void registerLobbyPlayer (int position, int vehicleIndex)
 Registers the lobby player. More...
 
virtual void unregisterLobbyPlayer (int position)
 Unregisters the lobby player. More...
 

Public Attributes

string LobbyScene = "LocalLobby"
 the name of the lobby scene. More...
 
GameObject[] AvailableVehiclesPrefabs
 the list of vehicle Prefabs the player can choose from. More...
 
string[] AvailableTracksSceneName
 the list of Track Scenes names. Used to load scene & show scene name in UI More...
 
Sprite[] AvailableTracksSprite
 the list of tracks sprites. Used to show an image of the chosen track in UI More...
 
- Public Attributes inherited from MoreMountains.Tools.MMPersistentSingleton< LocalLobbyManager >
bool AutomaticallyUnparentOnAwake
 if this is true, this singleton will auto detach if it finds itself parented on awake More...
 

Protected Attributes

Dictionary< int, ILobbyPlayerInfo_players = new Dictionary<int, ILobbyPlayerInfo>()
 
Dictionary< int, int > _registeredLobbyPlayers = new Dictionary<int, int>()
 
- Protected Attributes inherited from MoreMountains.Tools.MMPersistentSingleton< LocalLobbyManager >
bool _enabled
 

Properties

virtual int TrackSelected [getset]
 Stores currently selected track index. More...
 
virtual int MaxPlayers [get]
 Returns the maximum number of players. More...
 
- Properties inherited from MoreMountains.Tools.MMPersistentSingleton< LocalLobbyManager >
static bool HasInstance [get]
 
static T Current [get]
 
static T Instance [get]
 Singleton design pattern More...
 
- Properties inherited from MoreMountains.HighroadEngine.IGenericLobbyManager
int MaxPlayers [get]
 Returns the maximum number of players More...
 

Additional Inherited Members

- Protected Member Functions inherited from MoreMountains.Tools.MMPersistentSingleton< LocalLobbyManager >
virtual void Awake ()
 On awake, we check if there's already a copy of the object in the scene. If there's one, we destroy it. More...
 
- Static Protected Attributes inherited from MoreMountains.Tools.MMPersistentSingleton< LocalLobbyManager >
static T _instance
 

Detailed Description

This singleton class manages the list of players between races and lobby operations

Member Function Documentation

◆ AddPlayer()

virtual void MoreMountains.HighroadEngine.LocalLobbyManager.AddPlayer ( LocalLobbyPlayer  p)
virtual

Adds the player object to the active players list

Parameters
pLocalLobbyPlayer player

◆ ContainsPlayer()

virtual bool MoreMountains.HighroadEngine.LocalLobbyManager.ContainsPlayer ( int  position)
virtual

Returns true if a player is already registered for this position. Used when going back to the lobby scene after a game scene.

Returns
true, if player exists, false otherwise.
Parameters
positionPosition index.

◆ FindFreeVehicle()

virtual int MoreMountains.HighroadEngine.LocalLobbyManager.FindFreeVehicle ( )
virtual

Finds the next free vehicle index for a player.

Returns
The free vehicle index.

◆ GetPlayer()

virtual ILobbyPlayerInfo MoreMountains.HighroadEngine.LocalLobbyManager.GetPlayer ( int  position)
virtual

Gets the player by his position

Returns
The player
Parameters
positionPosition index

◆ IsReadyToPlay()

virtual bool MoreMountains.HighroadEngine.LocalLobbyManager.IsReadyToPlay ( )
virtual

Checks if the players are ready

Returns
true when at least one player is present and all players are ready.

◆ Players()

virtual Dictionary< int, ILobbyPlayerInfo > MoreMountains.HighroadEngine.LocalLobbyManager.Players ( )
virtual

Returns the active players list key is index, value is Player data.

◆ PlayersNotReadyCount()

virtual int MoreMountains.HighroadEngine.LocalLobbyManager.PlayersNotReadyCount ( )
virtual

Returns the number of players in lobby that are not ready yet

Returns
The players count.

◆ registerLobbyPlayer()

virtual void MoreMountains.HighroadEngine.LocalLobbyManager.registerLobbyPlayer ( int  position,
int  vehicleIndex 
)
virtual

Registers the lobby player.

Parameters
positionPosition.

///

Parameters
vehicleIndexVehicle Index.

◆ RemovePlayer()

virtual void MoreMountains.HighroadEngine.LocalLobbyManager.RemovePlayer ( int  position)
virtual

Removes the player from active players list

Parameters
positionPosition

◆ ReturnToLobby()

void MoreMountains.HighroadEngine.LocalLobbyManager.ReturnToLobby ( )

Changes the current scene to the lobby scene.

Implements MoreMountains.HighroadEngine.IGenericLobbyManager.

◆ ReturnToStartScreen()

virtual void MoreMountains.HighroadEngine.LocalLobbyManager.ReturnToStartScreen ( )
virtual

Changes the current scene to the start screen.

Implements MoreMountains.HighroadEngine.IGenericLobbyManager.

◆ Start()

virtual void MoreMountains.HighroadEngine.LocalLobbyManager.Start ( )
virtual

By default, we select the first track

◆ unregisterLobbyPlayer()

virtual void MoreMountains.HighroadEngine.LocalLobbyManager.unregisterLobbyPlayer ( int  position)
virtual

Unregisters the lobby player.

Parameters
positionPosition.

Member Data Documentation

◆ _players

Dictionary<int, ILobbyPlayerInfo> MoreMountains.HighroadEngine.LocalLobbyManager._players = new Dictionary<int, ILobbyPlayerInfo>()
protected

◆ _registeredLobbyPlayers

Dictionary<int, int> MoreMountains.HighroadEngine.LocalLobbyManager._registeredLobbyPlayers = new Dictionary<int, int>()
protected

◆ AvailableTracksSceneName

string [] MoreMountains.HighroadEngine.LocalLobbyManager.AvailableTracksSceneName

the list of Track Scenes names. Used to load scene & show scene name in UI

◆ AvailableTracksSprite

Sprite [] MoreMountains.HighroadEngine.LocalLobbyManager.AvailableTracksSprite

the list of tracks sprites. Used to show an image of the chosen track in UI

◆ AvailableVehiclesPrefabs

GameObject [] MoreMountains.HighroadEngine.LocalLobbyManager.AvailableVehiclesPrefabs

the list of vehicle Prefabs the player can choose from.

◆ LobbyScene

string MoreMountains.HighroadEngine.LocalLobbyManager.LobbyScene = "LocalLobby"

the name of the lobby scene.

Property Documentation

◆ MaxPlayers

virtual int MoreMountains.HighroadEngine.LocalLobbyManager.MaxPlayers
get

Returns the maximum number of players.

The maximum number of players.

◆ TrackSelected

virtual int MoreMountains.HighroadEngine.LocalLobbyManager.TrackSelected
getset

Stores currently selected track index.

The currently selected track.


The documentation for this class was generated from the following file: