public decimal SpreadRecordAfterWin(DateTime since) { var dt = Utility.TflWs.GetAllGamesDt(TeamCode); var winsAfterWin = 0.0M; var lossesAfterWin = 0.0M; var lastResultWasWin = false; foreach (DataRow dr in dt.Rows) { if (DateTime.Parse(dr["GameDate"].ToString()) <= since) continue; var game = new NFLGame(dr); if (lastResultWasWin) { if (game.WonVsSpread(this)) winsAfterWin++; else lossesAfterWin++; } lastResultWasWin = game.Won(this); // outright win } var totGames = winsAfterWin + lossesAfterWin; if (totGames == 0.0M) return 0.0M; return (winsAfterWin / totGames); }
public decimal RecordAfterWin(DateTime since) { var dt = Utility.TflWs.GetAllGamesDt(TeamCode); var winsAfterWin = 0.0M; var lossesAfterWin = 0.0M; var lastResultWasWin = false; foreach (DataRow dr in dt.Rows) { if (DateTime.Parse(dr["GameDate"].ToString()) > since) { var game = new NFLGame(dr); if (lastResultWasWin) { if (game.Won(this)) winsAfterWin++; else lossesAfterWin++; } lastResultWasWin = game.Won(this); } } return (winsAfterWin / (winsAfterWin + lossesAfterWin)); }