Пример #1
0
        private static void ScorePlayer(
            RetroRosters sut,
            Player plyr,
            int[] skipWeeks = null)
        {
            var pm = new PlayerReportModel
            {
                PlayerName = plyr.Name,
                Season     = "1988",
                Position   = plyr.Position
            };
            var stats88 = sut.StatsRepo.GetStats(pm);

            if (skipWeeks != null)
            {
                stats88 = RemoveWeeks(stats88, skipWeeks);
            }
            var tds = stats88.Sum(s => s.Scores());

            plyr.CurrentScores = tds;
            pm.Season          = "1989";
            var stats89 = sut.StatsRepo.GetStats(pm);

            tds = stats89.Sum(s => s.Scores());
            plyr.FutureScores = tds;
            plyr.Points       = plyr.CurrentScores + plyr.FutureScores;
        }
Пример #2
0
        private List <Player> PartialRoster(
            List <string> result,
            string position,
            RetroRosters sut = null,
            int[] skipWeeks  = null)
        {
            var players = new List <Player>();

            foreach (var item in result)
            {
                if (item.Contains(position + " "))
                {
                    if (sut == null)
                    {
                        continue;
                    }
                    var plyr = sut.PlayerFrom(item);
                    ScorePlayer(sut, plyr, skipWeeks);
                    players.Add(plyr);
                }
            }
            return(players);
        }