1
0
Fork 0
mirror of https://github.com/ppy/osu-tools.git synced 2025-06-09 09:35:15 +09:00

revert offtopic change

This commit is contained in:
Givikap120 2024-11-15 20:46:40 +02:00
parent 66b20a6fdd
commit 640f2b5349

View file

@ -45,7 +45,7 @@ namespace PerformanceCalculator.Simulate
protected override Dictionary<HitResult, int> GenerateHitResults(IBeatmap beatmap) => generateHitResults(beatmap, Accuracy / 100, Misses, Mehs, Goods, largeTickMisses, sliderTailMisses);
private static Dictionary<HitResult, int> generateHitResults(IBeatmap beatmap, double accuracy, int countMiss, int? countMeh, int? countGood, int? countLargeTickMisses, int? countSliderTailMisses)
private static Dictionary<HitResult, int> generateHitResults(IBeatmap beatmap, double accuracy, int countMiss, int? countMeh, int? countGood, int countLargeTickMisses, int countSliderTailMisses)
{
int countGreat;
@ -121,21 +121,15 @@ namespace PerformanceCalculator.Simulate
countGreat = (int)(totalResultCount - countGood - countMeh - countMiss);
}
var result = new Dictionary<HitResult, int>
return new Dictionary<HitResult, int>
{
{ HitResult.Great, countGreat },
{ HitResult.Ok, countGood ?? 0 },
{ HitResult.Meh, countMeh ?? 0 },
{ HitResult.LargeTickMiss, countLargeTickMisses },
{ HitResult.SliderTailHit, beatmap.HitObjects.Count(x => x is Slider) - countSliderTailMisses },
{ HitResult.Miss, countMiss }
};
if (countLargeTickMisses != null)
result[HitResult.LargeTickMiss] = countLargeTickMisses.Value;
if (countSliderTailMisses != null)
result[HitResult.SliderTailHit] = beatmap.HitObjects.Count(x => x is Slider) - countSliderTailMisses.Value;
return result;
}
protected override double GetAccuracy(IBeatmap beatmap, Dictionary<HitResult, int> statistics)
@ -145,28 +139,14 @@ namespace PerformanceCalculator.Simulate
var countMeh = statistics[HitResult.Meh];
var countMiss = statistics[HitResult.Miss];
double total = 6 * countGreat + 2 * countGood + countMeh;
double max = 6 * (countGreat + countGood + countMeh + countMiss);
if (statistics.ContainsKey(HitResult.SliderTailHit))
{
var countSliders = beatmap.HitObjects.Count(x => x is Slider);
var countSliderTailHit = statistics[HitResult.SliderTailHit];
total += 3 * countSliderTailHit;
max += 3 * countSliders;
}
if (statistics.ContainsKey(HitResult.LargeTickMiss))
{
var countLargeTicks = beatmap.HitObjects.Sum(obj => obj.NestedHitObjects.Count(x => x is SliderTick or SliderRepeat));
var countLargeTickHit = countLargeTicks - statistics[HitResult.LargeTickMiss];
total += 0.6 * countLargeTickHit;
max += 0.6 * countLargeTicks;
}
double total = 6 * (countGreat + countGood + countMeh + countMiss) + 3 * countSliders + 0.6 * countLargeTicks;
return total / max;
return (6 * countGreat + 2 * countGood + countMeh + 3 * countSliderTailHit + 0.6 * countLargeTickHit) / total;
}
}
}