Esempio n. 1
0
        public SoccerPlayer GetOlderTeamPlayer()
        {
            SoccerPlayer bestPlayer = _soccerPlayers.Values
                                      .OrderBy(player => player.BirtDate)
                                      .ThenBy(player => player.Id)
                                      .First();

            return(bestPlayer);
        }
Esempio n. 2
0
        public SoccerPlayer GetHigherSalaryPlayer()
        {
            SoccerPlayer bestPlayer = _soccerPlayers.Values
                                      .OrderByDescending(player => player.Salary)
                                      .ThenBy(player => player.Id)
                                      .First();

            return(bestPlayer);
        }
Esempio n. 3
0
        public SoccerPlayer GetBestPlayer()
        {
            SoccerPlayer bestPlayer = _soccerPlayers.Values
                                      .OrderByDescending(player => player.SkillLevel)
                                      .ThenBy(player => player.Id)
                                      .First();

            return(bestPlayer);
        }
Esempio n. 4
0
        public SoccerPlayer GetTeamCaptain()
        {
            SoccerPlayer captain = _soccerPlayers.Values.FirstOrDefault(player => player.Capitan);

            if (captain is null)
            {
                throw new CaptainNotFoundException();
            }
            else
            {
                return(captain);
            }
        }
Esempio n. 5
0
 public void AddPlayer(SoccerPlayer player)
 {
     _soccerPlayers.Add(player.Id, player);
 }