예제 #1
0
 public PerformanceReport(string season, int week, IRatePlayers scorer)
 {
     Season       = season;
     WeekNo       = week;
     Scorer       = scorer;
     PlayerLister = new PlayerLister();
 }
예제 #2
0
 public PerformanceReport( string season, int week, IRatePlayers scorer )
 {
     Season = season;
     WeekNo = week;
     Scorer = scorer;
     PlayerLister = new PlayerLister();
 }
예제 #3
0
        public PlayerCsv(IKeepTheTime timekeeper) : base(timekeeper)
        {
            Name = "Players CSV";
            SetLastRunDate();
            Lister  = new PlayerLister();
            Configs = new List <StarterConfig>
            {
                new StarterConfig {
                    Category = Constants.K_QUARTERBACK_CAT, Position = "QB"
                },
#if !DEBUG2
                new StarterConfig {
                    Category = Constants.K_RUNNINGBACK_CAT, Position = "RB"
                },
                new StarterConfig {
                    Category = Constants.K_RECEIVER_CAT, Position = "WR"
                },
                new StarterConfig {
                    Category = Constants.K_RECEIVER_CAT, Position = "TE"
                },
                new StarterConfig {
                    Category = Constants.K_KICKER_CAT, Position = "K"
                }
#endif
            };
        }
예제 #4
0
        public Starters(IKeepTheTime timekeeper) : base(timekeeper)
        {
            Name = "Starters";
            SetLastRunDate();
            Lister  = new PlayerLister();
            Configs = new List <StarterConfig>();
            Configs.Add(new StarterConfig {
                Category = Constants.K_QUARTERBACK_CAT, Position = "QB"
            });
#if !DEBUG
            Configs.Add(new StarterConfig {
                Category = Constants.K_RUNNINGBACK_CAT, Position = "RB"
            });
            Configs.Add(new StarterConfig {
                Category = Constants.K_RECEIVER_CAT, Position = "WR"
            });
            Configs.Add(new StarterConfig {
                Category = Constants.K_RECEIVER_CAT, Position = "TE"
            });
            Configs.Add(new StarterConfig {
                Category = Constants.K_KICKER_CAT, Position = "K"
            });
#endif
            Leagues = new List <RosterGridLeague> {
                new RosterGridLeague {
                    Id = Constants.K_LEAGUE_Gridstats_NFL1, Name = "GS1"
                }
            };
        }
예제 #5
0
        public void HotList(
            string catCode,
            string position,
            bool freeAgentsOnly,
            bool startersOnly)
        {
            var gs = new GS4Scorer(Utility.CurrentNFLWeek());

            PlayerLister = new PlayerLister
            {
                CatCode        = catCode,
                Position       = position,
                FantasyLeague  = League,
                Season         = Utility.CurrentSeason(),
                FreeAgentsOnly = freeAgentsOnly,
                StartersOnly   = startersOnly,
                Week           = Utility.PreviousWeek(),
                WeekMaster     = WeekMaster,
                WeeksToGoBack  = 4
            };
            PlayerLister.SetScorer(gs);
            PlayerLister.Load();
            PlayerLister.SubHeader = $"{PlayerLister.Position} HotList for {PlayerLister.FantasyLeague}";
            PlayerLister.FileOut   = $"HotLists//HotList-{PlayerLister.FantasyLeague}-{PlayerLister.Position}";
            PlayerLister.Render(PlayerLister.FileOut);
        }
예제 #6
0
 public PlayerCsv()
 {
     Name = "Players CSV";
      SetLastRunDate();
      Lister = new PlayerLister();
      Configs = new List<StarterConfig>
      {
     new StarterConfig {Category = Constants.K_QUARTERBACK_CAT, Position = "QB"},
     #if !DEBUG2
     new StarterConfig {Category = Constants.K_RUNNINGBACK_CAT, Position = "RB"},
     new StarterConfig {Category = Constants.K_RECEIVER_CAT, Position = "WR"},
     new StarterConfig {Category = Constants.K_RECEIVER_CAT, Position = "TE"},
     new StarterConfig {Category = Constants.K_KICKER_CAT, Position = "K"}
     #endif
      };
 }
예제 #7
0
 public Starters( bool doCsv )
 {
     Name = "Starters";
      SetLastRunDate();
      DoCsv = doCsv;
      Lister = new PlayerLister();
      Configs = new List<StarterConfig>();
      Configs.Add(new StarterConfig { Category = Constants.K_QUARTERBACK_CAT, Position = "QB" });
     #if ! DEBUG
      Configs.Add(new StarterConfig { Category = Constants.K_RUNNINGBACK_CAT, Position = "RB" });
      Configs.Add(new StarterConfig { Category = Constants.K_RECEIVER_CAT, Position = "WR" });
      Configs.Add(new StarterConfig { Category = Constants.K_RECEIVER_CAT, Position = "TE" });
      Configs.Add(new StarterConfig { Category = Constants.K_KICKER_CAT, Position = "K" });
     #endif
      Leagues = new List<RosterGridLeague> {new RosterGridLeague {Id = Constants.K_LEAGUE_Yahoo, Name = "Yahoo"}};
 }
예제 #8
0
        public void Render(string catCode, string sPos, string leagueId, bool startersOnly)
        {
            var currentWeek = new NFLWeek(seasonIn: Int32.Parse(Season), weekIn: 17, loadGames: false);

            if (currentWeek.WeekNo > 0)
            {
                var gs = leagueId.Equals(Constants.K_LEAGUE_Yahoo)
                                                        ? (IRatePlayers) new YahooScorer(currentWeek)
                                                        : new GS4Scorer(currentWeek)
                {
                    ScoresOnly = true
                };

                if (Scorer.Master == null)
                {
                    Scorer.Master = new YahooMaster("Yahoo", "YahooOutput.xml");
                }

                PlayerLister.SetScorer(Scorer);
                PlayerLister.SetFormat("weekly");
                PlayerLister.AllWeeks     = false;             //  dont go back into last year anymore
                PlayerLister.StartersOnly = startersOnly;
                PlayerLister.Clear();
                PlayerLister.Collect(catCode, sPos, leagueId);

                var targetFile = string.Format(leagueId.Equals(Constants.K_LEAGUE_Yahoo)
                                        ? "ESPN {1} Performance {0}" : "GS {1} Performance {0}", currentWeek.Season, sPos);

                var destinationFile = string.Format("{3}{2}//Performance//{0}-{1:0#}.htm",
                                                    targetFile, WeekNo, Season, Utility.OutputDirectory());

                FileOut = PlayerLister.Render(destinationFile);
            }
            else
            {
                Utility.Announce("Season has not started yet");
            }
        }
예제 #9
0
 public void HotList(string catCode, string position, bool freeAgentsOnly, bool startersOnly)
 {
     var gs = new GS4Scorer(Utility.CurrentNFLWeek());
      PlayerLister = new PlayerLister
      {
     CatCode = catCode,
     Position = position,
     FantasyLeague = League,
     Season = Utility.CurrentSeason(),
     FreeAgentsOnly = freeAgentsOnly,
     StartersOnly = startersOnly,
     Week = Utility.PreviousWeek(),
     WeekMaster = WeekMaster,
     WeeksToGoBack = 4
      };
      PlayerLister.SetScorer(gs);
      PlayerLister.Load();
      PlayerLister.SubHeader = string.Format("{1} HotList for {0}",
     PlayerLister.FantasyLeague, PlayerLister.Position);
      PlayerLister.FileOut = string.Format("HotLists//HotList-{0}-{1}",
     PlayerLister.FantasyLeague, PlayerLister.Position);
      PlayerLister.Render(PlayerLister.FileOut);
 }
예제 #10
0
 public Starters()
 {
     Lister = new PlayerLister();
 }
예제 #11
0
 public YahooProjector()
 {
     Lister = new PlayerLister();
 }
예제 #12
0
        public PerformanceReportGenerator(IKeepTheTime timekeeper) : base(timekeeper)
        {
            Logger = LogManager.GetCurrentClassLogger();
            Name   = "Fantasy Performance Reports";
            Lister = new PlayerLister(timekeeper)
            {
                WeeksToGoBack = 1,
                StartersOnly  = false
            };

            var master = new YahooMaster("Yahoo", "YahooOutput.xml");

            Logger.Trace("  using {0} which has {1} stats", master.Filename, master.TheHt.Count);

            var theWeek =
                new NFLWeek(Int32.Parse(timekeeper.CurrentSeason()),
                            weekIn: Int32.Parse(timekeeper.PreviousWeek()),
                            loadGames: false);

            var gs = new EspnScorer(theWeek)
            {
                Master = master
            };

            Configs = new List <PerformanceReportConfig>
            {
                new PerformanceReportConfig
                {
                    Category = Constants.K_QUARTERBACK_CAT,
                    Position = "QB",
                    Scorer   = gs,
                    Week     = theWeek
                },
                new PerformanceReportConfig
                {
                    Category = Constants.K_RUNNINGBACK_CAT,
                    Position = "RB",
                    Scorer   = gs,
                    Week     = theWeek
                },
                new PerformanceReportConfig
                {
                    Category = Constants.K_RECEIVER_CAT,
                    Position = "WR",
                    Scorer   = gs,
                    Week     = theWeek
                },
                new PerformanceReportConfig
                {
                    Category = Constants.K_RECEIVER_CAT,
                    Position = "TE",
                    Scorer   = gs,
                    Week     = theWeek
                },
                new PerformanceReportConfig
                {
                    Category = Constants.K_KICKER_CAT,
                    Position = "PK",
                    Scorer   = gs,
                    Week     = theWeek
                },
                //  4 weeks back
                new PerformanceReportConfig
                {
                    Category      = Constants.K_QUARTERBACK_CAT,
                    Position      = "QB",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 4
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RUNNINGBACK_CAT,
                    Position      = "RB",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 4
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RECEIVER_CAT,
                    Position      = "WR",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 4
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RECEIVER_CAT,
                    Position      = "TE",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 4
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_KICKER_CAT,
                    Position      = "PK",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 4
                },

                //  1 week back
                new PerformanceReportConfig
                {
                    Category      = Constants.K_QUARTERBACK_CAT,
                    Position      = "QB",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 1
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RUNNINGBACK_CAT,
                    Position      = "RB",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 1
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RECEIVER_CAT,
                    Position      = "WR",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 1
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_RECEIVER_CAT,
                    Position      = "TE",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 1
                },
                new PerformanceReportConfig
                {
                    Category      = Constants.K_KICKER_CAT,
                    Position      = "PK",
                    Scorer        = gs,
                    Week          = theWeek,
                    WeeksToGoBack = 1
                },
            };

            Leagues = new List <RosterGridLeague>();
            Leagues.Add(new RosterGridLeague {
                Id = Constants.K_LEAGUE_Yahoo, Name = "Spitzys League"
            });
#if !DEBUG
            Leagues.Add(new RosterGridLeague {
                Id = Constants.K_LEAGUE_Gridstats_NFL1, Name = "Gridstats GS1"
            });
            //Leagues.Add( new RosterGridLeague { Id = Constants.K_LEAGUE_Rants_n_Raves, Name = "NFL.COM" } );
#endif
        }
        public PerformanceReportGenerator(IKeepTheTime timekeeper)
        {
            Logger = LogManager.GetCurrentClassLogger();
             Name = "Fantasy Performance Reports";
             Lister = new PlayerLister( timekeeper ) {
            WeeksToGoBack = 1,
            StartersOnly = false
             };

             var master = new YahooMaster( "Yahoo", "YahooOutput.xml" );
             Logger.Info( "  using {0} which has {1} stats", master.Filename, master.TheHt.Count );

             var theWeek =
            new NFLWeek( Int32.Parse( timekeeper.CurrentSeason() ),
            weekIn: Int32.Parse( timekeeper.PreviousWeek() ),
            loadGames: false );

             var gs = new EspnScorer( theWeek ) { Master = master };

             Configs = new List<PerformanceReportConfig>
            {
               new PerformanceReportConfig
                  {
                     Category = Constants.K_QUARTERBACK_CAT,
                     Position = "QB",
                     Scorer = gs,
                     Week = theWeek
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RUNNINGBACK_CAT,
                     Position = "RB",
                     Scorer = gs,
                     Week = theWeek
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "WR",
                     Scorer = gs,
                     Week = theWeek
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "TE",
                     Scorer = gs,
                     Week = theWeek
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_KICKER_CAT,
                     Position = "PK",
                     Scorer = gs,
                     Week = theWeek
                  },
               //  4 weeks back
               new PerformanceReportConfig
                  {
                     Category = Constants.K_QUARTERBACK_CAT,
                     Position = "QB",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 4
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RUNNINGBACK_CAT,
                     Position = "RB",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 4
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "WR",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 4
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "TE",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 4
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_KICKER_CAT,
                     Position = "PK",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 4
                  },

               //  1 week back
               new PerformanceReportConfig
                  {
                     Category = Constants.K_QUARTERBACK_CAT,
                     Position = "QB",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 1
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RUNNINGBACK_CAT,
                     Position = "RB",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 1
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "WR",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 1
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_RECEIVER_CAT,
                     Position = "TE",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 1
                  },
               new PerformanceReportConfig
                  {
                     Category = Constants.K_KICKER_CAT,
                     Position = "PK",
                     Scorer = gs,
                     Week = theWeek,
                     WeeksToGoBack = 1
                  },
            };

             Leagues = new List<RosterGridLeague>();
             Leagues.Add( new RosterGridLeague { Id = Constants.K_LEAGUE_Yahoo, Name = "Spitzys League" } );
            #if ! DEBUG
             Leagues.Add( new RosterGridLeague { Id = Constants.K_LEAGUE_Gridstats_NFL1, Name = "Gridstats GS1" } );
             //Leagues.Add( new RosterGridLeague { Id = Constants.K_LEAGUE_Rants_n_Raves, Name = "NFL.COM" } );
            #endif
        }
예제 #14
0
 public PerformanceReport( string season, int week )
 {
     Season = season;
     WeekNo = week;
     PlayerLister = new PlayerLister();
 }
예제 #15
0
 public PerformanceReport(string season, int week)
 {
     Season       = season;
     WeekNo       = week;
     PlayerLister = new PlayerLister();
 }
예제 #16
0
 public YahooProjector()
 {
     Lister = new PlayerLister();
 }
        private static string WeeklyEspnPerformance(
         string catCode, int week, string leagueId, [System.Runtime.InteropServices.Optional] string sPos )
        {
            var pl = new PlayerLister { WeeksToGoBack = 1 };
             var master = new YahooMaster( "Yahoo", "YahooOutput.xml" );
             var currentWeek =
            new NFLWeek( Int32.Parse( Utility.CurrentSeason() ), weekIn: week, loadGames: false );
             var gs = new YahooScorer( currentWeek ) { Master = master };

             pl.SetScorer( gs );
             pl.SetFormat( "weekly" );
             pl.AllWeeks = false; //  just the regular saeason
             pl.Season = currentWeek.Season;
             pl.RenderToCsv = false;
             pl.Week = week;
             pl.Collect( catCode, sPos: sPos, fantasyLeague: leagueId );

             var targetFile = string.Format( "{4}{3}//Performance//{2}-Yahoo {1} Performance upto Week {0}.htm",
            currentWeek.WeekNo, sPos, leagueId, pl.Season, Utility.OutputDirectory() );
             pl.Render( targetFile );
             return pl.FileOut;
        }