public MetricsUpdateReport( IKeepTheTime timekeeper)
 {
     Name = "Metrics Update Report";
      Season = timekeeper.CurrentSeason();
       Week = new NFLWeek( Season, timekeeper.PreviousWeek());
     Scorer = new YahooScorer(Week);
     Dao = new DbfPlayerGameMetricsDao();
 }
 public MetricsUpdateReport(IKeepTheTime timekeeper) : base(timekeeper)
 {
     Name   = "Metrics Update Report";
     Season = timekeeper.CurrentSeason();
     Week   = new NFLWeek(Season, timekeeper.PreviousWeek());
     Scorer = new YahooScorer(Week);
     Dao    = new DbfPlayerGameMetricsDao();
 }
Exemplo n.º 3
0
        public string ActualOutput(
            NFLGame game,
            NFLPlayer player,
            List <NFLPlayer> runners,
            bool isReport = true)
        {
            if (!game.Played(addDay: false))
            {
                if (isReport)
                {
                    return("____");
                }
                else
                {
                    return(string.Empty);
                }
            }

            if (game.GameWeek == null)
            {
                game.GameWeek = new NFLWeek(
                    game.Season,
                    game.Week);
            }

            var scorer = new YahooScorer(game.GameWeek)
            {
                UseProjections = false
            };

            var nScore = 0.0M;

            if (player == null)              //  no ace back
            {
                if (runners == null)
                {
                    return(string.Empty);
                }

                foreach (NFLPlayer runner in runners)
                {
                    scorer.RatePlayer(runner, game.GameWeek);
                    nScore += runner.Points;
                }
                return($" {nScore,2:#0} ");
            }

            nScore = scorer.RatePlayer(
                player,
                game.GameWeek,
                takeCache: false);
            player.Points = nScore;
            return(PlayerPointsOut(
                       player,
                       isReport));
        }
Exemplo n.º 4
0
        public string ActualOutput(NFLGame g, NFLPlayer p)
        {
            if (!g.Played(addDay: false))
            {
                return("____");
            }

            Console.WriteLine(g.ScoreOut());
            if (g.GameWeek == null)
            {
                g.GameWeek = new NFLWeek(g.Season, g.Week);
            }

            var scorer = new YahooScorer(g.GameWeek)
            {
                UseProjections = false
            };
            var nScore = scorer.RatePlayer(
                p,
                g.GameWeek,
                takeCache: false);

            return($" {nScore,2:#0} ");
        }
Exemplo n.º 5
0
        public string ActualOutput(NFLGame g, NFLPlayer p)
        {
            if ( ! g.Played() )
                return "____";

            Console.WriteLine(g.ScoreOut());
            if ( g.GameWeek == null ) g.GameWeek = new NFLWeek(g.Season, g.Week);
            var scorer = new YahooScorer(g.GameWeek);
            var nScore = scorer.RatePlayer(p, g.GameWeek);
            return string.Format(" {0,2:#0} ", nScore);
        }