mirror of
https://github.com/ppy/osu
synced 2025-02-20 20:47:09 +00:00
More comments
This commit is contained in:
parent
7ee0370d23
commit
35f64d9aae
@ -105,6 +105,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
// Subtract any break time from the duration since the last object
|
// Subtract any break time from the duration since the last object
|
||||||
if (beatmap.Breaks.Count > 0)
|
if (beatmap.Breaks.Count > 0)
|
||||||
{
|
{
|
||||||
|
// Advance the last break occuring before the current time
|
||||||
while (currentBreak + 1 < beatmap.Breaks.Count && beatmap.Breaks[currentBreak + 1].EndTime < currentTime)
|
while (currentBreak + 1 < beatmap.Breaks.Count && beatmap.Breaks[currentBreak + 1].EndTime < currentTime)
|
||||||
currentBreak++;
|
currentBreak++;
|
||||||
|
|
||||||
@ -126,7 +127,7 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
if (Math.Abs(lowestHealth - targetMinimumHealth) <= minimum_health_error)
|
if (Math.Abs(lowestHealth - targetMinimumHealth) <= minimum_health_error)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// This effectively works like a binary search - each iteration the search space moves closer to the the target, but may exceed it.
|
// This effectively works like a binary search - each iteration the search space moves closer to the target, but may exceed it.
|
||||||
adjustment *= 2;
|
adjustment *= 2;
|
||||||
result += 1.0 / adjustment * Math.Sign(lowestHealth - targetMinimumHealth);
|
result += 1.0 / adjustment * Math.Sign(lowestHealth - targetMinimumHealth);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user