|
Highroad Engine v1.3
|
This singleton class manages the list of players between races and lobby operations More...
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, ILobbyPlayerInfo > | Players () |
| 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 |
This singleton class manages the list of players between races and lobby operations
|
virtual |
Adds the player object to the active players list
| p | LocalLobbyPlayer player |
|
virtual |
Returns true if a player is already registered for this position. Used when going back to the lobby scene after a game scene.
true, if player exists, false otherwise.| position | Position index. |
|
virtual |
Finds the next free vehicle index for a player.
|
virtual |
Gets the player by his position
| position | Position index |
|
virtual |
Checks if the players are ready
true when at least one player is present and all players are ready.
|
virtual |
Returns the active players list key is index, value is Player data.
|
virtual |
Returns the number of players in lobby that are not ready yet
|
virtual |
Registers the lobby player.
| position | Position. |
///
| vehicleIndex | Vehicle Index. |
|
virtual |
Removes the player from active players list
| position | Position |
| void MoreMountains.HighroadEngine.LocalLobbyManager.ReturnToLobby | ( | ) |
Changes the current scene to the lobby scene.
Implements MoreMountains.HighroadEngine.IGenericLobbyManager.
|
virtual |
Changes the current scene to the start screen.
Implements MoreMountains.HighroadEngine.IGenericLobbyManager.
|
virtual |
By default, we select the first track
|
virtual |
Unregisters the lobby player.
| position | Position. |
|
protected |
|
protected |
| string [] MoreMountains.HighroadEngine.LocalLobbyManager.AvailableTracksSceneName |
the list of Track Scenes names. Used to load scene & show scene name in UI
| Sprite [] MoreMountains.HighroadEngine.LocalLobbyManager.AvailableTracksSprite |
the list of tracks sprites. Used to show an image of the chosen track in UI
| GameObject [] MoreMountains.HighroadEngine.LocalLobbyManager.AvailableVehiclesPrefabs |
the list of vehicle Prefabs the player can choose from.
| string MoreMountains.HighroadEngine.LocalLobbyManager.LobbyScene = "LocalLobby" |
the name of the lobby scene.
|
get |
Returns the maximum number of players.
The maximum number of players.
|
getset |
Stores currently selected track index.
The currently selected track.