Ejemplo n.º 1
0
 public LobbyBasicState(LobbyState lobbyState)
 {
     Id          = lobbyState.Id;
     DisplayName = lobbyState.DisplayName;
     PlayerCount = lobbyState.Players.Count;
     MaxPlayers  = lobbyState.MaxPlayers;
 }
Ejemplo n.º 2
0
 public static void RemovePlayer(this LobbyState state, string id)
 {
     for (int i = 0; i < state.Players.Count; i++)
     {
         if (state.Players[i].Id == id)
         {
             state.Players.RemoveAt(i);
             break;
         }
     }
 }
Ejemplo n.º 3
0
 //---- Lobby State ----
 //---------------------
 #region Lobby extensions
 public static bool ContainsPlayerId(this LobbyState state, string id)
 {
     for (int i = 0; i < state.Players.Count; i++)
     {
         if (state.Players[i].Id == id)
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 4
0
 public static void AddPlayer(this LobbyState state, string id, string name)
 {
     state.Players.Add(new LobbyPlayerState(id, name));
 }