Exemplo n.º 1
0
        private void TakePlayerOffHisList(PlayerViewModel player)
        {
            switch (player.Area)
            {
            case EnumArea.AttackLeft:
                LeftAttackPlayers.Remove(player);
                break;

            case EnumArea.AttackCenter:
                CenterAttackPlayers.Remove(player);
                break;

            case EnumArea.AttackRight:
                RightAttackPlayers.Remove(player);
                break;

            case EnumArea.MiddleLeft:
                LeftMiddlePlayers.Remove(player);
                break;

            case EnumArea.MiddleCenter:
                CenterMiddlePlayers.Remove(player);
                break;

            case EnumArea.MiddleRight:
                RightMiddlePlayers.Remove(player);
                break;

            case EnumArea.DefenseLeft:
                LeftDefensePlayers.Remove(player);
                break;

            case EnumArea.DefenseCenter:
                CenterDefensePlayers.Remove(player);
                break;

            case EnumArea.DefenseRight:
                RightDefensePlayers.Remove(player);
                break;

            case EnumArea.GoalKeeper:
                GoalKeeperPlayer = null;
                break;
            }
        }
Exemplo n.º 2
0
 private void TakePlayerOffHisList(PlayerViewModel player)
 {
     switch(player.Area)
     {
         case EnumArea.AttackLeft:
             LeftAttackPlayers.Remove(player);
             break;
         case EnumArea.AttackCenter:
             CenterAttackPlayers.Remove(player);
             break;
         case EnumArea.AttackRight:
             RightAttackPlayers.Remove(player);
             break;
         case EnumArea.MiddleLeft:
             LeftMiddlePlayers.Remove(player);
             break;
         case EnumArea.MiddleCenter:
             CenterMiddlePlayers.Remove(player);
             break;
         case EnumArea.MiddleRight:
             RightMiddlePlayers.Remove(player);
             break;
         case EnumArea.DefenseLeft:
             LeftDefensePlayers.Remove(player);
             break;
         case EnumArea.DefenseCenter:
             CenterDefensePlayers.Remove(player);
             break;
         case EnumArea.DefenseRight:
             RightDefensePlayers.Remove(player);
             break;
         case EnumArea.GoalKeeper:
             GoalKeeperPlayer = null;
             break;
     }
 }
Exemplo n.º 3
0
        public TacticViewModel(ITeam team)
        {
            // Initialisation des listes
            Players = new List<PlayerViewModel>();
            LeftAttackPlayers = new ObservableCollection<PlayerViewModel>();
            CenterAttackPlayers = new ObservableCollection<PlayerViewModel>();
            RightAttackPlayers = new ObservableCollection<PlayerViewModel>();
            LeftMiddlePlayers = new ObservableCollection<PlayerViewModel>();
            CenterMiddlePlayers = new ObservableCollection<PlayerViewModel>();
            RightMiddlePlayers = new ObservableCollection<PlayerViewModel>();
            LeftDefensePlayers = new ObservableCollection<PlayerViewModel>();
            CenterDefensePlayers = new ObservableCollection<PlayerViewModel>();
            RightDefensePlayers = new ObservableCollection<PlayerViewModel>();

            foreach (var teamPlayer in team.Players)
            {
                PlayerViewModel playerViewModel = new PlayerViewModel();
                playerViewModel.Area = teamPlayer.Area;
                playerViewModel.Attack = teamPlayer.Attack;
                playerViewModel.Defense = teamPlayer.Defense;
                playerViewModel.Name = teamPlayer.Name;
                playerViewModel.Number = teamPlayer.Number;
                playerViewModel.Position = teamPlayer.Position;
                playerViewModel.PlayerSelectedEvent += playerSelectedEvent;
                Players.Add(playerViewModel);
            }
        }
Exemplo n.º 4
0
 private void AddPlayerToHisList(PlayerViewModel player)
 {
     switch (player.Area)
     {
         case EnumArea.AttackLeft:
             LeftAttackPlayers.Add(player);
             break;
         case EnumArea.AttackCenter:
             CenterAttackPlayers.Add(player);
             break;
         case EnumArea.AttackRight:
             RightAttackPlayers.Add(player);
             break;
         case EnumArea.MiddleLeft:
             LeftMiddlePlayers.Add(player);
             break;
         case EnumArea.MiddleCenter:
             CenterMiddlePlayers.Add(player);
             break;
         case EnumArea.MiddleRight:
             RightMiddlePlayers.Add(player);
             break;
         case EnumArea.DefenseLeft:
             LeftDefensePlayers.Add(player);
             break;
         case EnumArea.DefenseCenter:
             CenterDefensePlayers.Add(player);
             break;
         case EnumArea.DefenseRight:
             RightDefensePlayers.Add(player);
             break;
         case EnumArea.GoalKeeper:
             if (GoalKeeperPlayer != null)
                 GoalKeeperPlayer.Area = EnumArea.None;
             GoalKeeperPlayer = player;
             break;
     }
 }