mirror of
https://github.com/ppy/osu
synced 2025-01-23 22:33:05 +00:00
Change variable name and inline it
This commit is contained in:
parent
bf67b35ade
commit
c90b285861
@ -67,12 +67,10 @@ namespace osu.Game.Beatmaps
|
||||
if (api.LocalUser.Value.RulesetsStatistics == null)
|
||||
return;
|
||||
|
||||
foreach (var statistic in api.LocalUser.Value.RulesetsStatistics)
|
||||
foreach (var kvp in api.LocalUser.Value.RulesetsStatistics)
|
||||
{
|
||||
decimal? pp = api.LocalUser.Value.RulesetsStatistics[statistic.Key].PP;
|
||||
// algorithm taken from https://github.com/ppy/osu-web/blob/e6e2825516449e3d0f3f5e1852c6bdd3428c3437/app/Models/User.php#L1505
|
||||
double recommended = Math.Pow((double)(pp ?? 0), 0.4) * 0.195;
|
||||
recommendedDifficultyMapping[statistic.Key] = recommended;
|
||||
recommendedDifficultyMapping[kvp.Key] = Math.Pow((double)(kvp.Value.PP ?? 0), 0.4) * 0.195;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user