public DataSet LoadProjectedData( ArrayList plyrList, IRatePlayers scorer, IWeekMaster weekMaster, IAdpMaster adpMaster = null) { var ds = new DataSet(); var dt = new DataTable(); DefineReportColumns(dt); if (Season == null) { Season = Utility.CurrentSeason(); } var dao = new DbfPlayerGameMetricsDao(); foreach (NFLPlayer p in plyrList) { if (p.PlayerName.Equals("Mark Ingram")) { Console.WriteLine("TestPlayer check"); } var pgms = dao.GetSeason(Season, p.PlayerCode); var totPoints = 0M; foreach (PlayerGameMetrics pgm in pgms) { var nWeek = Int32.Parse(pgm.Week()); var theWeek = weekMaster.GetWeek( season: Season, week: nWeek); // We are only concerned with the first 4 weeks //if (nWeek > 4) // continue; // if there is no scorer it just reads the stats, // this is what we want if (scorer == null) { p.Points = pgm.CalculateProjectedFantasyPoints(p); } else { scorer.RatePlayer(p, theWeek); } if (p.TotStats == null) { p.TotStats = new PlayerStats(); } p.TotStats.Tdp += pgm.ProjTDp; p.TotStats.YDp += pgm.ProjYDp; p.TotStats.Tdr += pgm.ProjTDr; p.TotStats.Tdc += pgm.ProjTDc; p.TotStats.YDr += pgm.ProjYDr; p.TotStats.YDc += pgm.ProjYDc; p.TotStats.Fg += pgm.ProjFG; totPoints += p.Points; } if (totPoints > 0 || !SupressZeros) { var dr = dt.NewRow(); dr["Name"] = p.ProjectionLink(Season); dr["Pos"] = p.PlayerPos; dr["Role"] = p.RoleOut(); dr["RookieYr"] = p.RookieYear; dr["CurrTeam"] = p.TeamCode; if (ShowOpponent) { dr["Opponent"] = p.Opponent; dr["Spread"] = p.PlayerSpread; dr["OppRate"] = p.OppRate; } if (p.Owner == null) { p.LoadOwner(); } dr["FT"] = p.Owner; dr["Age"] = p.PlayerAge(); if (LongStats) { dr["cat"] = p.PlayerCat; dr["scoremod"] = p.ScoreModifier(); dr["seasons"] = p.NoOfSeasons(); dr["newteam"] = p.IsNewbie() ? "*" : string.Empty; dr["CurSCORES"] = p.CurrScores; dr["SCORES"] = p.Scores; dr["Avg"] = p.ScoresPerYear(); dr["INJURY"] = p.Injuries(); dr["Tdp"] = p.TotStats.Tdp; dr["YDp"] = p.TotStats.YDp; dr["Tdr"] = p.TotStats.Tdr; dr["TDc"] = p.TotStats.Tdc; dr["YDr"] = p.TotStats.YDr; dr["YDc"] = p.TotStats.YDc; dr["Fg"] = p.TotStats.Fg; dr["Health"] = p.HealthRating(); dr["newbie"] = 1.0M - p.NewbieModifier(); dr["adjProj"] = AdjustedPoints( p, totPoints); dr["AgeRate"] = p.AgeRating(); } dr["Points"] = totPoints; if (!LongStats) { dr["Points"] = (int)AdjustedPoints( p, totPoints); } dr["Adp"] = AsDraftRound(p.Adp); if (adpMaster != null) { dr["Adp"] = adpMaster.GetAdp( p.PlayerName); } dt.Rows.Add(dr); //Logger.Trace($"{p.PlayerName:-20} {totPoints:0.0}"); } } ds.Tables.Add(dt); return(ds); }
public DataSet LoadData(ArrayList plyrList, NFLWeek startWeek) { var ds = new DataSet(); var dt = new DataTable(); var cols = dt.Columns; cols.Add("Name", typeof(String)); cols.Add("Currteam", typeof(String)); cols.Add("ROLE", typeof(String)); cols.Add("FT", typeof(String)); cols.Add("tot", typeof(Int32)); var currentWeek = new NFLWeek( Int32.Parse(TimeKeeper.Season), Int32.Parse(TimeKeeper.Week), loadGames: false); for (var w = Constants.K_WEEKS_IN_A_SEASON; w > 0; w--) { var fieldName = string.Format( FieldFormat, currentWeek.WeekNo); //Utility.Announce( // string.Format( "Adding field: {0}", fieldName ) ); cols.Add( fieldName, typeof(String)); currentWeek = currentWeek.PreviousWeek( currentWeek, loadgames: false, regularSeasonGamesOnly: false); } foreach (NFLPlayer p in plyrList) { decimal nTot = 0; var dr = dt.NewRow(); dr["Name"] = p.ProjectionLink(TimeKeeper.Season); dr["CurrTeam"] = p.TeamCode; dr["ROLE"] = p.PlayerRole; dr["FT"] = p.Owner; var weekCounter = Constants.K_WEEKS_IN_A_SEASON; var weeksDone = 0; var scoreWeek = WeekMaster != null ? WeekMaster.GetWeek(startWeek.Season, 17) : new NFLWeek( startWeek.Season, Constants.K_WEEKS_IN_REGULAR_SEASON); do { var game = scoreWeek.GameFor(p.TeamCode); var cOp = game == null ? string.Empty : game.OpponentOut(p.TeamCode); var nScore = 0M; if (game != null) { if (game.Played()) { nScore = _scorer.RatePlayer(p, scoreWeek); nTot += nScore; weeksDone++; } } if (game != null && game.Played()) { dr[string.Format(FieldFormat, scoreWeek.WeekNo)] = string.Format("{0:0}:{1}", nScore, cOp) + "<br>" + OpponentDefence(p, game); } else { dr[string.Format(FieldFormat, scoreWeek.WeekNo)] = string.Format("{0:#}:{1}", nScore, cOp) + "<br>" + OpponentDefence(p, game); } scoreWeek = WeekMaster != null?WeekMaster.PreviousWeek(scoreWeek) : scoreWeek.PreviousWeek(scoreWeek, false, false); if (CurrentSeasonOnly) { if (scoreWeek.Season != Utility.CurrentSeason()) { weekCounter = 0; // breaks you out of the loop } } if (weeksDone >= WeeksToGoBack) { break; } weekCounter--; } while (weekCounter > 0); dr["tot"] = nTot; dt.Rows.Add(dr); } ds.Tables.Add(dt); return(ds); }
public DataSet LoadData(ArrayList plyrList, NFLWeek startWeek) { var ds = new DataSet(); var dt = new DataTable(); var cols = dt.Columns; cols.Add("Name", typeof(String)); cols.Add("Currteam", typeof(String)); cols.Add("ROLE", typeof(String)); cols.Add("FT", typeof(String)); cols.Add("tot", typeof(Int32)); var currentWeek = new NFLWeek(Int32.Parse(Utility.CurrentSeason()), Int32.Parse(Utility.CurrentWeek()), false); for (var w = Constants.K_WEEKS_IN_A_SEASON; w > 0; w--) { var fieldName = string.Format(FieldFormat, currentWeek.WeekNo); cols.Add(fieldName, typeof(String)); currentWeek = currentWeek.PreviousWeek(currentWeek, false, false); } foreach (NFLPlayer p in plyrList) { decimal nTot = 0; var dr = dt.NewRow(); dr["Name"] = p.PlayerName; dr["CurrTeam"] = p.TeamCode; dr["ROLE"] = p.PlayerRole; dr["FT"] = p.Owner; var weekCounter = Constants.K_WEEKS_IN_A_SEASON; // var scoreWeek = startWeek; var scoreWeek = new NFLWeek(startWeek.Season, Constants.K_WEEKS_IN_REGULAR_SEASON); do { var game = scoreWeek.GameFor(p.TeamCode); var cOp = game == null ? string.Empty : game.OpponentOut(p.TeamCode); var nScore = 0M; if (game != null) { if (game.Played()) { nScore = _scorer.RatePlayer(p, scoreWeek); nTot += nScore; } } dr[string.Format(FieldFormat, scoreWeek.WeekNo)] = string.Format("{0:#}:{1}", nScore, cOp); scoreWeek = scoreWeek.PreviousWeek(scoreWeek, false, false); if (CurrentSeasonOnly) { if (scoreWeek.Season != Utility.CurrentSeason()) { weekCounter = 0; } } weekCounter--; } while (weekCounter > 0); dr["tot"] = nTot; dt.Rows.Add(dr); } ds.Tables.Add(dt); return(ds); }
public DataSet LoadData( ArrayList plyrList, IRatePlayers scorer) { var ds = new DataSet(); var dt = new DataTable(); var cols = dt.Columns; cols.Add("Name", typeof(String)); cols.Add("Pos", typeof(String)); cols.Add("Role", typeof(String)); cols.Add("RookieYr", typeof(String)); cols.Add("Age", typeof(String)); cols.Add("Currteam", typeof(String)); cols.Add("FT", typeof(String)); if (LongStats) { cols.Add("CurScores", typeof(Int32)); cols.Add("Scores", typeof(Int32)); cols.Add("Avg", typeof(Decimal)); cols.Add("Injury", typeof(Int32)); cols.Add("Tdp", typeof(Int32)); cols.Add("YDp", typeof(Int32)); cols.Add("Tdr", typeof(Int32)); cols.Add("TDc", typeof(Int32)); cols.Add("YDr", typeof(Int32)); cols.Add("YDc", typeof(Int32)); cols.Add("Fg", typeof(Int32)); } cols.Add("Points", typeof(Decimal)); cols.Add("AgeRate", typeof(Decimal)); cols.Add("ADP", typeof(Int32)); if (Season == null) { Season = Utility.CurrentSeason(); } foreach (NFLPlayer p in plyrList) { if (p.TotStats == null) { p.LoadPerformances( allGames: false, currSeasonOnly: true, whichSeason: Season); // to get the stats } // rate the last whatevr weeks var theWeek = WeekMaster != null? WeekMaster.GetWeek(Season, Week) : new NFLWeek( Int32.Parse(Season), Week, loadGames: true); var totPoints = 0M; for (var w = WeeksToGoBack; w > 0; w--) { if (scorer != null) { scorer.RatePlayer( p, theWeek); } totPoints += p.Points; theWeek = WeekMaster != null ? WeekMaster.PreviousWeek(theWeek) : theWeek.PreviousWeek( theWeek: theWeek, loadgames: false, regularSeasonGamesOnly: false); } if (totPoints <= 0 && SupressZeros) { continue; } DataRow dr = PopulatePlayerRow(dt, p, totPoints); dt.Rows.Add(dr); } ds.Tables.Add(dt); return(ds); }
public DataSet LoadData(ArrayList plyrList, IRatePlayers scorer) { var ds = new DataSet(); var dt = new DataTable(); var cols = dt.Columns; cols.Add("Name", typeof (String)); cols.Add("Pos", typeof (String)); cols.Add("Role", typeof (String)); cols.Add("RookieYr", typeof (String)); cols.Add("Age", typeof (String)); cols.Add("Currteam", typeof (String)); cols.Add("FT", typeof (String)); if (LongStats) { cols.Add("CurScores", typeof (Int32)); cols.Add("Scores", typeof (Int32)); cols.Add("Avg", typeof (Decimal)); cols.Add("Injury", typeof (Int32)); cols.Add("Tdp", typeof (Int32)); cols.Add("YDp", typeof (Int32)); cols.Add("Tdr", typeof (Int32)); cols.Add("TDc", typeof (Int32)); cols.Add("YDr", typeof (Int32)); cols.Add("YDc", typeof (Int32)); cols.Add("Fg", typeof (Int32)); } cols.Add("Points", typeof (Decimal)); if (Season == null) Season = Utility.CurrentSeason(); foreach (NFLPlayer p in plyrList) { if (p.TotStats == null) p.LoadPerformances(false, true, Season); // to get the stats // rate the last whatevr weeks var theWeek = WeekMaster != null ? WeekMaster.GetWeek( Season, Week ) : new NFLWeek(Int32.Parse(Season), Week, loadGames:true); var totPoints = 0M; for (var w = WeeksToGoBack; w > 0; w--) { if (scorer != null) scorer.RatePlayer(p, theWeek); totPoints += p.Points; theWeek = WeekMaster != null ? WeekMaster.PreviousWeek( theWeek ) : theWeek.PreviousWeek(theWeek,false,false); } if (totPoints <= 0 && SupressZeros) continue; var dr = dt.NewRow(); if ( RenderToCsv ) dr[ "Name" ] = p.PlayerName; else dr[ "Name" ] = p.ProjectionLink( Season ); dr["Pos"] = p.PlayerPos; dr["Role"] = p.RoleOut(); dr["RookieYr"] = p.RookieYear +"-"+p.Drafted; dr["CurrTeam"] = p.TeamCode; dr["FT"] = p.Owner; dr["Age"] = p.PlayerAge(); if (LongStats) { dr["CurSCORES"] = p.CurrScores; dr["SCORES"] = p.Scores; dr["Avg"] = p.ScoresPerYear(); dr["INJURY"] = p.Injuries(); dr["Tdp"] = p.TotStats.Tdp; dr["YDp"] = p.TotStats.YDp; dr["Tdr"] = p.TotStats.Tdr; dr["TDc"] = p.TotStats.Tdc; dr["YDr"] = p.TotStats.YDr; dr["YDc"] = p.TotStats.YDc; dr["Fg"] = p.TotStats.Fg; } dr["Points"] = totPoints; dt.Rows.Add(dr); } ds.Tables.Add(dt); return ds; }
public DataSet LoadProjectedData( ArrayList plyrList, IRatePlayers scorer, IWeekMaster weekMaster ) { var ds = new DataSet(); var dt = new DataTable(); var cols = dt.Columns; cols.Add("Name", typeof (String)); cols.Add("Pos", typeof (String)); cols.Add("Role", typeof (String)); cols.Add("RookieYr", typeof (String)); cols.Add("Age", typeof (String)); cols.Add("Currteam", typeof (String)); if (ShowOpponent) { cols.Add("Opponent", typeof(String)); cols.Add("Spread", typeof(String)); cols.Add("OppRate", typeof(String)); } cols.Add("FT", typeof (String)); if (LongStats) { cols.Add("CurScores", typeof (Int32)); cols.Add("Scores", typeof (Int32)); cols.Add("Avg", typeof (Decimal)); cols.Add("Injury", typeof (Int32)); cols.Add("Tdp", typeof (Int32)); cols.Add("YDp", typeof (Int32)); cols.Add("Tdr", typeof (Int32)); cols.Add("TDc", typeof (Int32)); cols.Add("YDr", typeof (Int32)); cols.Add("YDc", typeof (Int32)); cols.Add("Fg", typeof (Int32)); cols.Add( "Health", typeof( Decimal ) ); cols.Add( "AdjProj", typeof( Int32 ) ); } cols.Add("Points", typeof (Decimal)); if (Season == null) Season = Utility.CurrentSeason(); var dao = new DbfPlayerGameMetricsDao(); foreach (NFLPlayer p in plyrList) { var pgms = dao.GetSeason(Season, p.PlayerCode); var totPoints = 0M; foreach (PlayerGameMetrics pgm in pgms) { var theWeek = weekMaster.GetWeek( Season, Int32.Parse( pgm.Week() ) ); // if there is no scorer it just reads the stats, this is what we want if ( scorer == null ) p.Points = pgm.CalculateProjectedFantasyPoints(p); else scorer.RatePlayer( p, theWeek ); if ( p.TotStats == null) p.TotStats = new PlayerStats(); p.TotStats.Tdp += pgm.ProjTDp; p.TotStats.YDp += pgm.ProjYDp; p.TotStats.Tdr += pgm.ProjTDr; p.TotStats.Tdc += pgm.ProjTDc; p.TotStats.YDr += pgm.ProjYDr; p.TotStats.YDc += pgm.ProjYDc; p.TotStats.Fg += pgm.ProjFG; totPoints += p.Points; } if (totPoints > 0 || !SupressZeros) { var dr = dt.NewRow(); dr["Name"] = p.PlayerName; dr["Pos"] = p.PlayerPos; dr["Role"] = p.RoleOut(); dr["RookieYr"] = p.RookieYear; dr["CurrTeam"] = p.TeamCode; if (ShowOpponent) { dr["Opponent"] = p.Opponent; dr["Spread"] = p.PlayerSpread; dr["OppRate"] = p.OppRate; } if (p.Owner == null) p.LoadOwner(); dr["FT"] = p.Owner; dr["Age"] = p.PlayerAge(); if (LongStats) { dr["CurSCORES"] = p.CurrScores; dr["SCORES"] = p.Scores; dr["Avg"] = p.ScoresPerYear(); dr["INJURY"] = p.Injuries(); dr["Tdp"] = p.TotStats.Tdp; dr["YDp"] = p.TotStats.YDp; dr["Tdr"] = p.TotStats.Tdr; dr["TDc"] = p.TotStats.Tdc; dr["YDr"] = p.TotStats.YDr; dr["YDc"] = p.TotStats.YDc; dr["Fg"] = p.TotStats.Fg; dr[ "Health" ] = p.HealthRating(); dr[ "AdjProj" ] = p.HealthRating()*totPoints; } dr["Points"] = totPoints; dt.Rows.Add(dr); } } ds.Tables.Add(dt); return ds; }
public DataSet LoadProjectedData( ArrayList plyrList, IRatePlayers scorer, IWeekMaster weekMaster) { var ds = new DataSet(); var dt = new DataTable(); var cols = dt.Columns; cols.Add("Name", typeof(String)); cols.Add("Pos", typeof(String)); cols.Add("Role", typeof(String)); cols.Add("RookieYr", typeof(String)); cols.Add("Age", typeof(String)); cols.Add("Currteam", typeof(String)); if (ShowOpponent) { cols.Add("Opponent", typeof(String)); cols.Add("Spread", typeof(String)); cols.Add("OppRate", typeof(String)); } cols.Add("FT", typeof(String)); if (LongStats) { cols.Add("CurScores", typeof(Int32)); cols.Add("Scores", typeof(Int32)); cols.Add("Avg", typeof(Decimal)); cols.Add("Injury", typeof(Int32)); cols.Add("Tdp", typeof(Int32)); cols.Add("YDp", typeof(Int32)); cols.Add("Tdr", typeof(Int32)); cols.Add("TDc", typeof(Int32)); cols.Add("YDr", typeof(Int32)); cols.Add("YDc", typeof(Int32)); cols.Add("Fg", typeof(Int32)); cols.Add("Health", typeof(Decimal)); cols.Add("AdjProj", typeof(Int32)); } cols.Add("Points", typeof(Decimal)); cols.Add("PFP", typeof(Int32)); cols.Add("Adp", typeof(Int32)); if (Season == null) { Season = Utility.CurrentSeason(); } var dao = new DbfPlayerGameMetricsDao(); foreach (NFLPlayer p in plyrList) { var pgms = dao.GetSeason(Season, p.PlayerCode); var totPoints = 0M; foreach (PlayerGameMetrics pgm in pgms) { var theWeek = weekMaster.GetWeek(Season, Int32.Parse(pgm.Week())); // if there is no scorer it just reads the stats, this is what we want if (scorer == null) { p.Points = pgm.CalculateProjectedFantasyPoints(p); } else { scorer.RatePlayer(p, theWeek); } if (p.TotStats == null) { p.TotStats = new PlayerStats(); } p.TotStats.Tdp += pgm.ProjTDp; p.TotStats.YDp += pgm.ProjYDp; p.TotStats.Tdr += pgm.ProjTDr; p.TotStats.Tdc += pgm.ProjTDc; p.TotStats.YDr += pgm.ProjYDr; p.TotStats.YDc += pgm.ProjYDc; p.TotStats.Fg += pgm.ProjFG; totPoints += p.Points; } if (totPoints > 0 || !SupressZeros) { var dr = dt.NewRow(); dr["Name"] = p.PlayerName; dr["Pos"] = p.PlayerPos; dr["Role"] = p.RoleOut(); dr["RookieYr"] = p.RookieYear; dr["CurrTeam"] = p.TeamCode; if (ShowOpponent) { dr["Opponent"] = p.Opponent; dr["Spread"] = p.PlayerSpread; dr["OppRate"] = p.OppRate; } if (p.Owner == null) { p.LoadOwner(); } dr["FT"] = p.Owner; dr["Age"] = p.PlayerAge(); if (LongStats) { dr["CurSCORES"] = p.CurrScores; dr["SCORES"] = p.Scores; dr["Avg"] = p.ScoresPerYear(); dr["INJURY"] = p.Injuries(); dr["Tdp"] = p.TotStats.Tdp; dr["YDp"] = p.TotStats.YDp; dr["Tdr"] = p.TotStats.Tdr; dr["TDc"] = p.TotStats.Tdc; dr["YDr"] = p.TotStats.YDr; dr["YDc"] = p.TotStats.YDc; dr["Fg"] = p.TotStats.Fg; dr["Health"] = p.HealthRating(); dr["AdjProj"] = p.HealthRating() * totPoints; } dr["Points"] = totPoints; dr["PFP"] = p.Rating; dr["Adp"] = p.Adp; dt.Rows.Add(dr); //Logger.Info( $"{p.PlayerName:-20} {totPoints:0.0}" ); } } ds.Tables.Add(dt); return(ds); }
public DataSet LoadData(ArrayList plyrList, IRatePlayers scorer) { var ds = new DataSet(); var dt = new DataTable(); var cols = dt.Columns; cols.Add("Name", typeof(String)); cols.Add("Pos", typeof(String)); cols.Add("Role", typeof(String)); cols.Add("RookieYr", typeof(String)); cols.Add("Age", typeof(String)); cols.Add("Currteam", typeof(String)); cols.Add("FT", typeof(String)); if (LongStats) { cols.Add("CurScores", typeof(Int32)); cols.Add("Scores", typeof(Int32)); cols.Add("Avg", typeof(Decimal)); cols.Add("Injury", typeof(Int32)); cols.Add("Tdp", typeof(Int32)); cols.Add("YDp", typeof(Int32)); cols.Add("Tdr", typeof(Int32)); cols.Add("TDc", typeof(Int32)); cols.Add("YDr", typeof(Int32)); cols.Add("YDc", typeof(Int32)); cols.Add("Fg", typeof(Int32)); } cols.Add("Points", typeof(Decimal)); cols.Add("PFP", typeof(Decimal)); cols.Add("ADP", typeof(Int32)); if (Season == null) { Season = Utility.CurrentSeason(); } foreach (NFLPlayer p in plyrList) { if (p.TotStats == null) { p.LoadPerformances(false, true, Season); // to get the stats } // rate the last whatevr weeks var theWeek = WeekMaster != null? WeekMaster.GetWeek(Season, Week) : new NFLWeek(Int32.Parse(Season), Week, loadGames: true); var totPoints = 0M; for (var w = WeeksToGoBack; w > 0; w--) { if (scorer != null) { scorer.RatePlayer(p, theWeek); } totPoints += p.Points; theWeek = WeekMaster != null?WeekMaster.PreviousWeek(theWeek) : theWeek.PreviousWeek(theWeek, false, false); } if (totPoints <= 0 && SupressZeros) { continue; } var dr = dt.NewRow(); if (RenderToCsv) { dr["Name"] = p.PlayerName; } else { dr["Name"] = p.ProjectionLink(Season); } dr["Pos"] = p.PlayerPos; dr["Role"] = p.RoleOut(); dr["RookieYr"] = p.RookieYear + "-" + p.Drafted; dr["CurrTeam"] = p.TeamCode; dr["FT"] = p.Owner; dr["Age"] = p.PlayerAge(); if (LongStats) { dr["CurSCORES"] = p.CurrScores; dr["SCORES"] = p.Scores; dr["Avg"] = p.ScoresPerYear(); dr["INJURY"] = p.Injuries(); dr["Tdp"] = p.TotStats.Tdp; dr["YDp"] = p.TotStats.YDp; dr["Tdr"] = p.TotStats.Tdr; dr["TDc"] = p.TotStats.Tdc; dr["YDr"] = p.TotStats.YDr; dr["YDc"] = p.TotStats.YDc; dr["Fg"] = p.TotStats.Fg; } dr["Points"] = totPoints; dr["PFP"] = p.Rating; dr["ADP"] = p.Adp; dt.Rows.Add(dr); } ds.Tables.Add(dt); return(ds); }
public DataSet LoadProjectedData(ArrayList plyrList, IRatePlayers scorer) { var ds = new DataSet(); var dt = new DataTable(); var cols = dt.Columns; cols.Add("Name", typeof(String)); cols.Add("Pos", typeof(String)); cols.Add("Role", typeof(String)); cols.Add("RookieYr", typeof(String)); cols.Add("Age", typeof(String)); cols.Add("Currteam", typeof(String)); cols.Add("Opponent", typeof(String)); cols.Add("Spread", typeof(String)); cols.Add("OppRate", typeof(String)); cols.Add("FT", typeof(String)); if (LongStats) { cols.Add("CurScores", typeof(Int32)); cols.Add("Scores", typeof(Int32)); cols.Add("Avg", typeof(Decimal)); cols.Add("Injury", typeof(Int32)); cols.Add("Tdp", typeof(Int32)); cols.Add("YDp", typeof(Int32)); cols.Add("Tdr", typeof(Int32)); cols.Add("TDc", typeof(Int32)); cols.Add("YDr", typeof(Int32)); cols.Add("YDc", typeof(Int32)); cols.Add("Fg", typeof(Int32)); } cols.Add("Points", typeof(Decimal)); if (Season == null) { Season = Utility.CurrentSeason(); } foreach (NFLPlayer p in plyrList) { if (p.TotStats == null) { p.LoadPerformances(false, true, Season); // to get the stats } // rate the last whatevr weeks var theWeek = new NFLWeek(Int32.Parse(Season), Week, false); // start here var totPoints = 0M; if (scorer != null) { scorer.RatePlayer(p, theWeek); } totPoints += p.Points; if (totPoints > 0 || !SupressZeros) { var dr = dt.NewRow(); dr["Name"] = p.PlayerName; dr["Pos"] = p.PlayerPos; dr["Role"] = p.RoleOut(); dr["RookieYr"] = p.RookieYear; dr["CurrTeam"] = p.TeamCode; dr["Opponent"] = p.Opponent; dr["Spread"] = p.PlayerSpread; dr["OppRate"] = p.OppRate; dr["FT"] = p.Owner; dr["Age"] = p.PlayerAge(); if (LongStats) { dr["CurSCORES"] = p.CurrScores; dr["SCORES"] = p.Scores; dr["Avg"] = p.ScoresPerYear(); dr["INJURY"] = p.Injuries(); dr["Tdp"] = p.TotStats.Tdp; dr["YDp"] = p.TotStats.YDp; dr["Tdr"] = p.TotStats.Tdr; dr["TDc"] = p.TotStats.Tdc; dr["YDr"] = p.TotStats.YDr; dr["YDc"] = p.TotStats.YDc; dr["Fg"] = p.TotStats.Fg; } dr["Points"] = totPoints; dt.Rows.Add(dr); } } ds.Tables.Add(dt); return(ds); }