Beispiel #1
0
 public decimal SpreadRecordAfterLoss(DateTime since)
 {
     var dt = Utility.TflWs.GetAllGamesDt(TeamCode);
      var winsAfterLoss = 0.0M;
      var lossesAfterLoss = 0.0M;
      var spreadRecord = 0.0M;
      var lastResultWasLoss = false;
      foreach (DataRow dr in dt.Rows)
      {
     if (DateTime.Parse(dr["GameDate"].ToString()) <= since) continue;
     NFLGame game = new NFLGame(dr);
     if (lastResultWasLoss)
     {
        if (game.WonVsSpread(this))
           winsAfterLoss++;
        else
           lossesAfterLoss++;
     }
     lastResultWasLoss = game.Lost(this); //  outright loss
      }
      if (winsAfterLoss + lossesAfterLoss > 0)
     spreadRecord = winsAfterLoss / (winsAfterLoss + lossesAfterLoss);
      return spreadRecord;
 }