private async Task <TrueskillRating> GetOrAddRating(ulong userId) { var rating = await _ratings.GetRating(userId); if (rating.HasValue) { return(rating.Value); } rating = new TrueskillRating(userId, uint.MaxValue, _gameInfo.DefaultRating.Mean, _gameInfo.DefaultRating.StandardDeviation); await _ratings.SetRating(userId, rating.Value.Mean, rating.Value.StdDev); return(rating.Value); }
private static Rating Convert(TrueskillRating rating) { return(new Rating(rating.Mean, rating.StdDev)); }