mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Update Cached usage according to framework
This commit is contained in:
@ -81,13 +81,8 @@ namespace osu.Game.Rulesets.Timing
|
||||
}
|
||||
|
||||
private Cached<double> durationBacking = new Cached<double>();
|
||||
/// <summary>
|
||||
/// The maximum duration of any one hit object inside this <see cref="DrawableTimingSection"/>. This is calculated as the maximum
|
||||
/// end time between all hit objects relative to this <see cref="DrawableTimingSection"/>'s <see cref="MultiplierControlPoint.StartTime"/>.
|
||||
/// </summary>
|
||||
public double Duration => durationBacking.EnsureValid()
|
||||
? durationBacking.Value
|
||||
: durationBacking.Refresh(() =>
|
||||
|
||||
private double computeDuration()
|
||||
{
|
||||
if (!Children.Any())
|
||||
return 0;
|
||||
@ -117,7 +112,13 @@ namespace osu.Game.Rulesets.Timing
|
||||
baseDuration *= 1 + maxAbsoluteSize / ourAbsoluteSize;
|
||||
|
||||
return baseDuration;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The maximum duration of any one hit object inside this <see cref="DrawableTimingSection"/>. This is calculated as the maximum
|
||||
/// end time between all hit objects relative to this <see cref="DrawableTimingSection"/>'s <see cref="MultiplierControlPoint.StartTime"/>.
|
||||
/// </summary>
|
||||
public double Duration => durationBacking.IsValid ? durationBacking : (durationBacking.Value = computeDuration());
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
|
Reference in New Issue
Block a user