Exemple #1
0
 public CSGLMatch(CSGLMatchRecord NewRecord, CSGLMatchOdds NewOdds)
 {
     if (NewRecord.match != NewOdds.match)
         throw new Exception("Matches do not match");
     if (NewRecord.closed == 0)
         throw new Exception("Match not yet ended");
     RecOddsToMatch(NewRecord, NewOdds);
 }
Exemple #2
0
        private void RecOddsToMatch(CSGLMatchRecord NewRecord, CSGLMatchOdds NewOdds)
        {
            matchId = NewRecord.match;
            teamA = NewRecord.a;
            teamB = NewRecord.b;
            date = NewRecord.when;
            winner = NewRecord.winner;
            format = NewRecord.format;

            double itemsA = NewOdds.a;
            double itemsB = NewOdds.b;
            double totalItems = itemsA + itemsB;
            oddsA = itemsA / totalItems;
            oddsB = itemsB / totalItems;
            coefA = 1 + itemsB / itemsA;
            coefB = 1 + itemsA / itemsB;
        }