mirror of
https://github.com/osukey/osukey.git
synced 2025-06-22 19:57:56 +09:00
Ensure setting a StartTime
on a GameplayClockContainer
always resets to the new time
This commit is contained in:
parent
2c6fd1ec6e
commit
43879633db
@ -90,6 +90,9 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
AddUntilStep("sample has lifetime end", () => sample.LifetimeEnd < double.MaxValue);
|
AddUntilStep("sample has lifetime end", () => sample.LifetimeEnd < double.MaxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sample at 0ms, start time at 1000ms (so the sample should not be played).
|
||||||
|
/// </summary>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSampleHasLifetimeEndWithInitialClockTime()
|
public void TestSampleHasLifetimeEndWithInitialClockTime()
|
||||||
{
|
{
|
||||||
|
@ -38,12 +38,23 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time from which the clock should start. Will be seeked to on calling <see cref="Reset"/>.
|
/// The time from which the clock should start. Will be seeked to on calling <see cref="Reset"/>.
|
||||||
|
/// Settting a start time will <see cref="Reset"/> to the new value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// By default, a value of zero will be used.
|
/// By default, a value of zero will be used.
|
||||||
/// Importantly, the value will be inferred from the current beatmap in <see cref="MasterGameplayClockContainer"/> by default.
|
/// Importantly, the value will be inferred from the current beatmap in <see cref="MasterGameplayClockContainer"/> by default.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public double StartTime { get; set; } = 0;
|
public double StartTime
|
||||||
|
{
|
||||||
|
get => startTime;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
startTime = value;
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private double startTime;
|
||||||
|
|
||||||
public virtual IEnumerable<double> NonGameplayAdjustments => Enumerable.Empty<double>();
|
public virtual IEnumerable<double> NonGameplayAdjustments => Enumerable.Empty<double>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user