public int PredictSteals(NflTeam team, string season, int week)
        {
            //  Predict the number of Interceptions the team will make
            int ints = 0;
            //  who are the opponents
            NflTeam opponent = team.OpponentFor(season, week);

            if (opponent != null)
            {
                //  not on a bye
                int pdInts = ConvertRating(team.PrRating());
                int poInts = ConvertRating(opponent.PpRating());
                ints += (pdInts - poInts) - 1; //  will range from 3 to -5
            }

            //  What is the Game
            NFLGame game = team.GameFor(season, week);

            if (game != null)
            {
                if (game.IsHome(team.TeamCode))
                {
                    ints += 1;
                }
            }


            if (ints < 0)
            {
                ints = 0;
            }

            return(ints);
        }
        public Int32 PredictSacks(
            NflTeam team,
            string season,
            int week)
        {
            //  Predict the number of Sacks the team will make
            int sacks = 0;
            //  who are the opponents
            NflTeam opponent = team.OpponentFor(
                season,
                week);

            if (opponent != null)
            {
                //  not on a bye
                sacks += 1;
                int prSacks = ConvertRating(team.PrRating());
                int ppSacks = ConvertRating(opponent.PpRating());
                sacks += (prSacks - ppSacks);
            }

            //  What is the Game
            NFLGame game = team.GameFor(season, week);

            if (game != null)
            {
                if (game.IsHome(team.TeamCode))
                {
                    sacks += 1;
                }
                if (game.IsBadWeather())
                {
                    sacks += 1;
                }
            }

            if (sacks < 0)
            {
                sacks = 0;
            }

            return(sacks);
        }
Пример #3
0
        public Int32 PredictFGs(NFLPlayer plyr, string season, int week)
        {
            //  Predict the number of FGs this player will kick
            int fg = 0;

            //  starters only
            if (plyr.IsStarter())
            {
                //  who does he play for
                NflTeam kickersTeam = plyr.CurrTeam;

                //  who are the opponents
                NflTeam opponent = kickersTeam.OpponentFor(season, week);
                if (opponent != null)
                {
                    //  not on a bye
                    fg += 1;
                    if (opponent.IsGoodDefence())
                    {
                        fg += 1;
                    }
                }

                //  What is the Game
                NFLGame game = kickersTeam.GameFor(season, week);
                if (game != null)
                {
                    if (game.IsHome(kickersTeam.TeamCode))
                    {
                        fg += 1;
                    }
                    if (game.IsDomeGame())
                    {
                        fg += 1;
                    }
                    if (game.IsBadWeather())
                    {
                        fg -= 1;
                    }
                }
            }
            return(fg);
        }