internal double GetScoreBasedOnFormula(Match match, MatchPrediction matchPrediction, PenaltyPredictionType penaltyPredictionType) { var rawScore = (short)Math.Max(2, 10 - 2 * Math.Abs( Math.Abs(match.HomeTeamScore.MatchResult.Value - match.AwayTeamScore.MatchResult.Value) - Math.Abs(matchPrediction.HomeTeamScore.MatchResult.Value - matchPrediction.AwayTeamScore.MatchResult.Value)) - ((Math.Abs(match.AwayTeamScore.MatchResult.Value - matchPrediction.AwayTeamScore.MatchResult.Value)) + (Math.Abs(match.HomeTeamScore.MatchResult.Value - matchPrediction.HomeTeamScore.MatchResult.Value)))); if (penaltyPredictionType == PenaltyPredictionType.Correct) { rawScore += PenaltyPredictionScore; } return(rawScore * ScoreCoefficient); }
internal double GetScoreOfPredictionType(MatchPredictionType matchPredictionType, PenaltyPredictionType penaltyPredictionType) { var rawScore = 0; if (matchPredictionType == MatchPredictionType.Exact) { rawScore = ExactMatchResultPredictionScore; } if (matchPredictionType == MatchPredictionType.GoalDifference) { rawScore = GoalDifferencePredictionScore; } if (matchPredictionType == MatchPredictionType.MatchWinner) { rawScore = WinnerPredictionScore; } if (matchPredictionType == MatchPredictionType.Wrong) { rawScore = WrongPredictionScore; } if (penaltyPredictionType == PenaltyPredictionType.Correct) { rawScore += PenaltyPredictionScore; } return(rawScore * ScoreCoefficient); }