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 EspnScorer(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); }
private static void DoRantsReport(PlayerLister pl, NFLWeek theWeek, EspnScorer gs, string leagueId, string rptPos, string cat) { pl.SetScorer(gs); pl.StartersOnly = true; // more thorough to do false pl.SetFormat("weekly"); // as opposed to "annual" totals pl.AllWeeks = false; // just the regular season pl.Season = theWeek.Season; pl.Collect(catCode: cat, sPos: rptPos, fantasyLeague: leagueId); var targetFile = string.Format("{2}{0}//Performance//{3}-Yahoo {1} Performance {0}.htm", pl.Season, rptPos, Utility.OutputDirectory(), leagueId); pl.Render(targetFile); Assert.IsTrue(File.Exists(pl.FileOut), string.Format("Cannot find {0}", pl.FileOut)); }
public void TestRantsPerformanceUptoCurrent() { var pl = new PlayerLister(); var theWeek = new NFLWeek(seasonIn: 2013, weekIn: System.Int32.Parse(Utility.CurrentWeek()), loadGames: false); var gs = new EspnScorer(theWeek); var leagueId = Constants.K_LEAGUE_Rants_n_Raves; DoRantsReport(pl, theWeek, gs, leagueId, "QB", Constants.K_QUARTERBACK_CAT); DoRantsReport(pl, theWeek, gs, leagueId, "RB", Constants.K_RUNNINGBACK_CAT); DoRantsReport(pl, theWeek, gs, leagueId, "WR", Constants.K_RECEIVER_CAT); DoRantsReport(pl, theWeek, gs, leagueId, "TE", Constants.K_RECEIVER_CAT); DoRantsReport(pl, theWeek, gs, leagueId, "PK", Constants.K_KICKER_CAT); }
public void TestYahooPerformanceUptoCurrent() { var pl = new PlayerLister(); var theWeek = new NFLWeek(seasonIn: 2013, weekIn: System.Int32.Parse(Utility.CurrentWeek()), loadGames: false); var gs = new EspnScorer(theWeek); var leagueId = Constants.K_LEAGUE_Yahoo; var rptPos = "RB"; pl.SetScorer(gs); pl.StartersOnly = true; // more thorough to do false pl.SetFormat("weekly"); // as opposed to "annual" totals pl.AllWeeks = false; // just the regular season pl.Season = theWeek.Season; pl.Collect(catCode: Constants.K_RUNNINGBACK_CAT, sPos: rptPos, fantasyLeague: leagueId); var targetFile = string.Format("{2}{0}//Performance//Yahoo {1} Performance {0}-{3}.htm", pl.Season, rptPos, Utility.OutputDirectory(), leagueId); pl.Render(targetFile); Assert.IsTrue(File.Exists(pl.FileOut), string.Format("Cannot find {0}", pl.FileOut)); }
private void RenderAll(string leagueId) { var playerLister = new PlayerLister { StartersOnly = true }; for (int i = 1; i < 6; i++) { playerLister.Collect( catCode: CatForReport(i), sPos: PosForReport(i), fantasyLeague: leagueId); playerLister.Position = PosForReport(i); PlayerList = playerLister; RenderOne(); playerLister.Clear(); } }
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.CurrentNFLWeek().WeekNo }; 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); }
public RookieReportGenerator() { Lister = new PlayerLister(); }