public PlayersInGame DeletePlayer(int id) { Player p = _players.ToList().Find(player => player.Id == id); _players.Remove(p); return(_players); }
public void RemovePlayer(Player player) { if (player.Spectator) { return; } if (GameState != GameState.LOBBY) { lock (PlayersInGame) PlayersInGame.Remove(player); --PlayersAllive; } PlayersInLobby.Remove(player); if (PlayersInLobby.Count >= 1) { Creator = PlayersInLobby[rnd.Next(0, PlayersInLobby.Count - 1)]; if (StartTimerRunning) { FramesToStart *= 2; } } player.InGame = false; }