Пример #1
0
        public void TallyTeam(
            ICollection <NflTeam> teamList,
            string season,
            DateTime focusDate,
            string teamCode)
        {
            var team = new NflTeam(teamCode);                //  simple code constructor

            if (TimeKeeper.IsItRegularSeason())
            {
                team.LoadGames(team.TeamCode, season);
                GameScope = GameScopeFromGameList(
                    team.GameList);
            }
            else
            {
                GameScope = $@"Regular season Games {
					Int32.Parse(season)-1
					}"                    ;
                team.LoadPreviousRegularSeasonGames(
                    team.TeamCode,
                    season,
                    focusDate);
            }
            team.TallyStats(Breakdowns);
            teamList.Add(team);
            var breakdownKey  = $"{team.TeamCode}-Q";
            var breakdownFile = $@"{Utility.OutputDirectory()}\\{
							TimeKeeper.CurrentSeason()
							}\\Metrics\\breakdowns\\{breakdownKey}.htm"                            ;

            Breakdowns.Dump(
                breakdownKey,
                breakdownFile);
        }
Пример #2
0
        public void TallyTeam(
            ICollection <NflTeam> teamList,
            string season,
            DateTime focusDate,
            string teamCode)
        {
            var team = new NflTeam(teamCode);                //  simple code constructor

            //if ( teamCode == "IC")
            //	Console.WriteLine("Test Team");
            if (thisSeasonOnly)
            {
                team.LoadGames(team.TeamCode, season);
            }
            else
            {
                team.LoadPreviousRegularSeasonGames(
                    team.TeamCode,
                    season,
                    focusDate);
            }
            team.TallyStats(
                breakdowns: null);
            teamList.Add(team);
        }
        public void TallyTeam(ICollection <NflTeam> teamList, string season, DateTime focusDate, string teamCode)
        {
            var team = new NflTeam(teamCode);                //  simple code constructor

            if (thisSeasonOnly)
            {
                team.LoadGames(team.TeamCode, season);
            }
            else
            {
                team.LoadPreviousRegularSeasonGames(team.TeamCode, season, focusDate);
            }
            team.TallyStats();
            teamList.Add(team);
        }
Пример #4
0
        public static int DefRating(NflTeam team, DateTime predictionDate)
        {
            team.LoadPreviousRegularSeasonGames(4, predictionDate);
            var defArray = new int[4];
            var i        = 0;

            foreach (NFLGame game in team.GameList)
            {
                defArray[i] = game.AgainstFor(team.TeamCode);
                i++;
            }
            Array.Sort(defArray);
            int tot = defArray[1] + defArray[2];

            return(tot / 2);
        }
Пример #5
0
        public static int OffRating(NflTeam team, DateTime predictionDate)
        {
            team.LoadPreviousRegularSeasonGames(4, predictionDate);
            var offArray = new int[4];
            var i        = 0;

            foreach (NFLGame game in team.GameList)
            {
                offArray[i] = game.ScoreFor(team.TeamCode);
                i++;
            }
            Array.Sort(offArray);
            var tot = offArray[1] + offArray[2];

            return(tot / 2);
        }