public void PpSnippet(NflTeam t) { FileOut = string.Format("{0}\\Prot\\PP-{1}.htm", RootPath(t.Season), t.TeamCode); var h = new HtmlFile(FileOut, string.Format(" {2} Pass Protection Unit as of {0} Week {1}", DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek(), t.NameOut())); h.AddToBody(HeaderPp(t)); h.AddToBody(t.PpReport()); h.Render(); }
private string PlayerProjectionsHtml(NflTeam nflTeam) { var html = HtmlLib.H4(nflTeam.NameOut()) + Environment.NewLine; html += HtmlLib.TableWithBorderOpen(); if (nflTeam.PlayerList.Count == 0) nflTeam.LoadPlayerUnits(); if (PgmDao == null) PgmDao = new DbfPlayerGameMetricsDao(); if (GameWeek == null) GameWeek = new NFLWeek( Season, Week ); var scorer = new YahooProjectionScorer(); var nPlayers = 0; var nTotPts = 0.0M; var totPgm = new PlayerGameMetrics(); foreach (NFLPlayer p in nflTeam.PlayerList) { if (!p.IsFantasyOffence()) continue; nPlayers++; var pgm = PgmDao.Get(p.PlayerCode, GameKey()); if (nPlayers == 1) html += pgm.PgmHeaderRow(); if (!pgm.HasNumbers()) continue; SetProjectedStats( p, pgm ); var fpts = scorer.RatePlayer( p, GameWeek ); nTotPts += fpts; html += HtmlLib.Para(pgm.FormatAsTableRow(p.PlayerName, p.PlayerRole, fpts)) + Environment.NewLine; totPgm.ProjYDp += pgm.ProjYDp; totPgm.ProjTDp += pgm.ProjTDp; totPgm.ProjYDr += pgm.ProjYDr; totPgm.ProjTDr += pgm.ProjTDr; totPgm.ProjYDc += pgm.ProjYDc; totPgm.ProjTDc += pgm.ProjTDc; totPgm.ProjFG += pgm.ProjFG; totPgm.ProjPat += pgm.ProjPat; } html += HtmlLib.Para(totPgm.FormatAsTableRow("Totals", "", nTotPts)) + Environment.NewLine; html += HtmlLib.TableClose(); return html; }
public void TallyStatsFor(NflTeam team) { #if DEBUG Utility.Announce("Tallying Stats for " + team.NameOut()); #endif var gameYDr = YDr(team.TeamCode); var gameYDp = YDp(team.TeamCode); var gameTDp = Tdp(team.TeamCode); var gameTdr = Tdr(team.TeamCode); var gameSacks = Sacks(team.TeamCode); var gameSacksAllowed = SacksAllowed(team.TeamCode); var gameYDrAllowed = YDrAllowed(team.TeamCode); var gameYDpAllowed = YDpAllowed(team.TeamCode); var gameTdpAllowed = TdpAllowed(team.TeamCode); var gameTdrAllowed = TdrAllowed(team.TeamCode); var gameInterceptions = IntsAllowed(team.TeamCode); var gameInterceptionsThrown = Interceptions(team.TeamCode); var gameFg = Fg(team.TeamCode); team.TotYdr += gameYDr; team.TotYdp += gameYDp; team.TotSacksAllowed += gameSacksAllowed; team.TotSacks += gameSacks; team.TotYdrAllowed += gameYDrAllowed; team.TotTDpAllowed += gameTdpAllowed; team.TotIntercepts += gameInterceptions; // NflStats are defined here if (StatList == null) StatList = new List<NflStat>(); StatList.Add(new NflStat(Season, Week, team.TeamCode, "YDr", gameYDr, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "YDp", gameYDp, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "TDp", gameTDp, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "TDr", gameTdr, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "TDrAllowed", gameTdrAllowed, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "Sacks", gameSacks, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "SacksAllowed", gameSacksAllowed, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "YDrAllowed", gameYDrAllowed, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "YDpAllowed", gameYDpAllowed, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "TDpAllowed", gameTdpAllowed, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "INTs", gameInterceptions, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "INTsThrown", gameInterceptionsThrown, Opponent(team.TeamCode))); StatList.Add(new NflStat(Season, Week, team.TeamCode, "FG", gameFg, Opponent(team.TeamCode))); }
public void RdSnippet(NflTeam t) { FileOut = string.Format("{0}\\RunDef\\RD-{1}.htm", RootPath(t.Season), t.TeamCode); var h = new HtmlFile(FileOut, string.Format(" {2} Run Defense Unit as of {0} Week {1}", DateTime.Now.ToString("dd MMM yy"), Utility.CurrentWeek(), t.NameOut())); h.AddToBody(HeaderRd(t)); h.AddToBody(t.RdReport()); h.Render(); }
private static string HeaderRo(NflTeam t) { return HtmlLib.H2(string.Format("Rushing Unit for {0}", t.NameOut())); }
private static string HeaderPr(NflTeam t) { return HtmlLib.H2(string.Format("Pass Rush Unit for {0}", t.NameOut())); }
private static string HeaderPp(NflTeam t) { return HtmlLib.H2(string.Format("Pass Protection Unit for {0}", t.NameOut())); }
private static string Header(NflTeam t) { return HtmlLib.H2(string.Format("Unit Reports for {0} as of {1}", t.NameOut(), DateTime.Now.ToString( "ddd dd MMM yy hh:mm" ) ) ); }
private static string Header(NflTeam t) { return HtmlLib.H2(string.Format("Free Agents for {0}", t.NameOut())); }