public static void Clear() { Player[] removedPlayers = players_.ToArray(); players_.Clear(); foreach (Player player in removedPlayers) { OnPlayerRemoved.Invoke(player); } }
public static void RemovePlayer(string name) { GetInstance(); if (instance.players.ContainsKey(name)) { Player aPlayer = instance.players[name]; instance.players.Remove(name); OnPlayerRemoved?.Invoke(aPlayer); } }
public bool RemovePlayer(PinouPlayer player) { if (player != null) { player.Destroy(); _players.Remove(player); OnPlayerRemoved.Invoke(player); return(true); } return(false); }
/// <summary> /// Удалить игрока из игры /// </summary> /// <param name="parPlayerId">Данные об удаляемом игроке</param> public void RemovePlayer(string parPlayerId) { MPlayer foundPlayer = _players.FirstOrDefault(parX => parX.PlayerId == parPlayerId); if (foundPlayer == null) { return; } _players.Remove(foundPlayer); OnPlayerRemoved?.Invoke(foundPlayer); }
private void OnUpdateTicked(object sender, UpdateTickedEventArgs e) { var currentLength = Game1.otherFarmers.Count; if (currentLength > _prevLength) { _monitor.VerboseLog("Player added"); OnPlayerAdded?.Invoke(); _prevLength = currentLength; } else if (currentLength < _prevLength) { _monitor.VerboseLog("Player removed"); OnPlayerRemoved?.Invoke(); _prevLength = currentLength; } }
public void RemovePlayer(int playerIndex) { if (activePlayers.Count > playerIndex) { var psData = activePlayers[playerIndex]; activePlayers.RemoveAt(playerIndex); OnPlayerRemoved?.Invoke(psData); for (int i = playerIndex; i < maxNumberOfPlayers; i++) { if (i < activePlayers.Count && activePlayers[i] != null) { PlayerSessionData pData = activePlayers[i]; pData.playerIndex = i; OnPlayerChangedIndex?.Invoke(pData, i + 1); } } } }
/// <summary> /// Deregisters a player from this dict. /// </summary> /// <param name="player">The player to be removed.</param> public void DeRegister(Player player) { Players.Remove(player); OnPlayerRemoved?.Invoke(player); }
public static void Remove(Player player) { players_.Remove(player); OnPlayerRemoved.Invoke(player); }