Ejemplo n.º 1
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;
            }
        }
Ejemplo 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;
            }
        }