Пример #1
0
        /// <summary>
        /// Tries to get the current standings for a single team.
        /// </summary>
        /// <param name="team">Team to query for in the standings.</param>
        /// <param name="divisionStandings">The division standings, if any were found. If not, this may be anything, but is most likely null.</param>
        /// <returns>True if that team was found, false otherwise.</returns>
        public bool TryGetStandingsForTeam(BaseballTeam team, out BaseballTeamStanding divisionStandings)
        {
            divisionStandings = null;
            Func <BaseballTeamStanding, bool> teamNameCheck = division => division.Team.Key.Equals(team.Key);

            if (_divisionalStandings.Any(teamNameCheck))
            {
                divisionStandings = _divisionalStandings.Single(teamNameCheck);
            }

            return(divisionStandings != null);
        }
Пример #2
0
 /// <summary>
 /// Adds the standings for a single team to our list.
 /// </summary>
 /// <param name="divisionStanding">Standings for a single team.</param>
 public void AddStandingsForTeam(BaseballTeamStanding divisionStanding)
 {
     _divisionalStandings.Add(divisionStanding);
 }
 /// <summary>
 /// Adds the current standings for a given team.
 /// </summary>
 /// <param name="divisionStanding">The team's current standings in terms of their division.</param>
 /// <param name="wildcardStanding">The team's current standings in terms of their wildcard position.</param>
 public void AddStandingsForTeam(BaseballTeamStanding divisionStanding, BaseballTeamStanding wildcardStanding)
 {
     AddStandingsForTeam(divisionStanding);
     _wildcardStandings.Add(wildcardStanding);
 }