public void RemovePlayerCommandHandler(object args) { if (SelectedAvailablePlayer != null && AvailablePlayers.Contains(SelectedAvailablePlayer)) { AvailablePlayers.Remove(SelectedAvailablePlayer); OnPropertyChanged("AvailablePlayers"); OnPropertyChanged("FilteredAvailablePlayers"); } }
public void AddPlayer() { if (SelectedPlayer != null) { TeamMembers.Add(SelectedPlayer); AvailablePlayers.Remove(SelectedPlayer); } ValidateAllData(); }
public void AddPlayer(object parameter) { playerEngine.ActivePlayers.Add(AvailablePlayer); SelectedPlayers.Add(AvailablePlayer); if (AvailablePlayer != null) { AvailablePlayers.Remove(AvailablePlayer); AvailablePlayer = null; } AvailablePlayer = null; }
private void OnUserDisconnect(string nick) { var helpPlayer = ConnectedPlayers.First(player => player.Nick == nick); ConnectedPlayers.Remove(helpPlayer); AvailablePlayers.Remove(nick); if (ChatTabs.Count == 0) { return; } var chatTab = ChatTabs.First(item => item.Header == nick); if (chatTab != null) { ChatTabs.Remove(chatTab); } }
private void ProcessDraftPick() { Player draftedPlayer = null; if (CurrentPick.Team.ManagerMode == ManagerMode.CPU) { draftedPlayer = draftService.DraftPlayer(CurrentPick.Team, AvailablePlayers.Where(player => CurrentPick.DraftCard.CanDraftPlayer(player))); } else { draftedPlayer = SelectedPlayer; } AvailablePlayers.Remove(draftedPlayer); CurrentPick.Player = draftedPlayer; SelectedDraftRound.DraftPicks.UpdateCollection(); NotifyPropertyChanged("CanDraftPlayer"); NotifyPropertyChanged("CanGoToNextPick"); NotifyPropertyChanged("DraftPanel"); SelectedPlayer = null; }
private void OnPlayerStarted(string nick) { ConnectedPlayers.First(player => player.Nick == nick).IsPlaying = true; AvailablePlayers.Remove(nick); }