Ejemplo n.º 1
0
 public void RemovePlayerCommandHandler(object args)
 {
     if (SelectedAvailablePlayer != null && AvailablePlayers.Contains(SelectedAvailablePlayer))
     {
         AvailablePlayers.Remove(SelectedAvailablePlayer);
         OnPropertyChanged("AvailablePlayers");
         OnPropertyChanged("FilteredAvailablePlayers");
     }
 }
Ejemplo n.º 2
0
        public void AddPlayer()
        {
            if (SelectedPlayer != null)
            {
                TeamMembers.Add(SelectedPlayer);
                AvailablePlayers.Remove(SelectedPlayer);
            }

            ValidateAllData();
        }
Ejemplo n.º 3
0
        public void AddPlayer(object parameter)
        {
            playerEngine.ActivePlayers.Add(AvailablePlayer);
            SelectedPlayers.Add(AvailablePlayer);

            if (AvailablePlayer != null)
            {
                AvailablePlayers.Remove(AvailablePlayer);
                AvailablePlayer = null;
            }
            AvailablePlayer = null;
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 6
0
        private void OnPlayerStarted(string nick)
        {
            ConnectedPlayers.First(player => player.Nick == nick).IsPlaying = true;

            AvailablePlayers.Remove(nick);
        }