public void newLobbyPlayer(clientPlayer newPlayer) { foreach (clientPlayer p in totalAssociatedPlayers) { if (newPlayer == p) { return; //The player already exists } } totalAssociatedPlayers.SetValue(newPlayer, totalAssociatedPlayers.GetUpperBound(1) + 1); }
public void playerJoinGame(clientPlayer newPlayer) { foreach (clientPlayer p in associatedPlayers) { if (newPlayer == p) { return; //player is already in game } } associatedPlayers.SetValue(newPlayer, associatedPlayers.GetUpperBound(1) + 1); }