Esempio n. 1
0
 /// <summary>
 /// Create a new player, register it, and assign an ID.
 /// </summary>
 /// <param name="connection">The connection this player is associated with.</param>
 /// <param name="gameBase">The game server that this player will be registered under.</param>
 /// <param name="playerID">PlayerID to pass in. This only needs to be defined by clients.</param>
 public Player(ConnectionID connection, GameBase gameBase, int playerID = -1)
 {
     ConnectionID = connection;
     CharacterSelection = -1;
     CharacterLocked = false;
     PlayerReady = false;
     if (playerID < 0)
     {
         PlayerID = gameBase.RegisterPlayer(this);
     }
     else
     {
         PlayerID = playerID;
         gameBase.RegisterPlayer(this);
     }
     return;
 }
Esempio n. 2
0
 /// <summary>
 /// Lobby constructor
 /// </summary>
 /// <param name="gameBase">The game base that this Lobby is associated with.</param>
 protected LobbyBase(GameBase gameBase)
 {
     Game = gameBase;
     return;
 }