public bool AddPlayer(int playerIndex) { for (int i = 0; i < AllowedPlayersIDs.Count; i++) { if (AllowedPlayersIDs[i] == playerIndex) { return(false); } } AllowedPlayersIDs.Add(playerIndex); return(true); }
public bool RemovePlayer(int playerIndex) { bool result = false; for (int i = 0; i < AllowedPlayersIDs.Count; i++) { if (AllowedPlayersIDs[i] == playerIndex) { AllowedPlayersIDs.RemoveAt(i); i--; result = true; } } return(result); }