コード例 #1
0
 private static bool ResultContainScores(ResultWebResponse result)
 {
     if (result == null)
     {
         return(false);
     }
     if (result.Score != null || result.Points != null || result.EquitableScore != null)
     {
         return(true);
     }
     return(false);
 }
コード例 #2
0
 private result CreateNewResult(match parentMatch, int teamId, ResultWebResponse clientResult, year year, int priorHandicap)
 {
     return(new result
     {
         match = parentMatch,
         score = clientResult.Score,
         points = clientResult.Points,
         scoreVariant = clientResult.EquitableScore,
         priorHandicap = priorHandicap,
         teamId = teamId,
         year = year,
         playerId = clientResult.PlayerId.Value
     });
 }
コード例 #3
0
        private static bool VerifyEquitableScore(ResultWebResponse result)
        {
            if (result == null)
            {
                return(true);
            }

            if (result.EquitableScore.HasValue)
            {
                return(result.EquitableScore.Value <= result.Score);
            }

            // escore is allowed to be null.
            return(true);
        }
コード例 #4
0
 private bool ShouldCreateResult(ResultWebResponse clientResult)
 {
     return(clientResult != null && clientResult.PlayerId.HasValue && clientResult.PlayerId != 0);
 }