1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 05:52:54 +08:00

Add time elapsation to judgement simulation

This commit is contained in:
smoogipoo 2019-12-24 17:12:58 +09:00
parent 90cb9d9162
commit 985277da79

View File

@ -47,6 +47,10 @@ namespace osu.Game.Rulesets.Scoring
Reset(true);
}
public virtual void ApplyElapsedTime(double elapsedTime)
{
}
/// <summary>
/// Applies the score change of a <see cref="JudgementResult"/> to this <see cref="ScoreProcessor"/>.
/// </summary>
@ -115,6 +119,8 @@ namespace osu.Game.Rulesets.Scoring
/// <param name="beatmap">The <see cref="IBeatmap"/> to simulate.</param>
protected virtual void SimulateAutoplay(IBeatmap beatmap)
{
HitObject lastObject = null;
foreach (var obj in beatmap.HitObjects)
simulate(obj);
@ -123,6 +129,9 @@ namespace osu.Game.Rulesets.Scoring
foreach (var nested in obj.NestedHitObjects)
simulate(nested);
if (lastObject != null)
ApplyElapsedTime(lastObject.GetEndTime() - obj.StartTime);
var judgement = obj.CreateJudgement();
if (judgement == null)
return;
@ -132,8 +141,9 @@ namespace osu.Game.Rulesets.Scoring
throw new InvalidOperationException($"{GetType().ReadableName()} must provide a {nameof(JudgementResult)} through {nameof(CreateResult)}.");
result.Type = judgement.MaxResult;
ApplyResult(result);
lastObject = obj;
}
}
}