mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
Remove acronym shortening of GameplayClockContainer
This commit is contained in:
parent
6556a7e3c3
commit
25cbe5a0de
@ -29,44 +29,44 @@ namespace osu.Game.Tests.Gameplay
|
||||
[Test]
|
||||
public void TestStartThenElapsedTime()
|
||||
{
|
||||
GameplayClockContainer gcc = null;
|
||||
GameplayClockContainer gameplayClockContainer = null;
|
||||
|
||||
AddStep("create container", () =>
|
||||
{
|
||||
var working = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
||||
working.LoadTrack();
|
||||
|
||||
Add(gcc = new MasterGameplayClockContainer(working, 0));
|
||||
Add(gameplayClockContainer = new MasterGameplayClockContainer(working, 0));
|
||||
});
|
||||
|
||||
AddStep("start clock", () => gcc.Start());
|
||||
AddUntilStep("elapsed greater than zero", () => gcc.GameplayClock.ElapsedFrameTime > 0);
|
||||
AddStep("start clock", () => gameplayClockContainer.Start());
|
||||
AddUntilStep("elapsed greater than zero", () => gameplayClockContainer.GameplayClock.ElapsedFrameTime > 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestElapseThenReset()
|
||||
{
|
||||
GameplayClockContainer gcc = null;
|
||||
GameplayClockContainer gameplayClockContainer = null;
|
||||
|
||||
AddStep("create container", () =>
|
||||
{
|
||||
var working = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
||||
working.LoadTrack();
|
||||
|
||||
Add(gcc = new MasterGameplayClockContainer(working, 0));
|
||||
Add(gameplayClockContainer = new MasterGameplayClockContainer(working, 0));
|
||||
});
|
||||
|
||||
AddStep("start clock", () => gcc.Start());
|
||||
AddUntilStep("current time greater 2000", () => gcc.GameplayClock.CurrentTime > 2000);
|
||||
AddStep("start clock", () => gameplayClockContainer.Start());
|
||||
AddUntilStep("current time greater 2000", () => gameplayClockContainer.GameplayClock.CurrentTime > 2000);
|
||||
|
||||
double timeAtReset = 0;
|
||||
AddStep("reset clock", () =>
|
||||
{
|
||||
timeAtReset = gcc.GameplayClock.CurrentTime;
|
||||
gcc.Reset();
|
||||
timeAtReset = gameplayClockContainer.GameplayClock.CurrentTime;
|
||||
gameplayClockContainer.Reset();
|
||||
});
|
||||
|
||||
AddAssert("current time < time at reset", () => gcc.GameplayClock.CurrentTime < timeAtReset);
|
||||
AddAssert("current time < time at reset", () => gameplayClockContainer.GameplayClock.CurrentTime < timeAtReset);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -76,29 +76,29 @@ namespace osu.Game.Tests.Gameplay
|
||||
[Values(false, true)] bool whileStopped)
|
||||
{
|
||||
ClockBackedTestWorkingBeatmap working = null;
|
||||
GameplayClockContainer gcc = null;
|
||||
GameplayClockContainer gameplayClockContainer = null;
|
||||
|
||||
AddStep("create container", () =>
|
||||
{
|
||||
working = new ClockBackedTestWorkingBeatmap(new OsuRuleset().RulesetInfo, new FramedClock(new ManualClock()), Audio);
|
||||
working.LoadTrack();
|
||||
|
||||
Add(gcc = new MasterGameplayClockContainer(working, 0));
|
||||
Add(gameplayClockContainer = new MasterGameplayClockContainer(working, 0));
|
||||
|
||||
if (whileStopped)
|
||||
gcc.Stop();
|
||||
gameplayClockContainer.Stop();
|
||||
|
||||
gcc.Reset();
|
||||
gameplayClockContainer.Reset();
|
||||
});
|
||||
|
||||
AddStep($"set clock rate to {clockRate}", () => working.Track.AddAdjustment(AdjustableProperty.Frequency, new BindableDouble(clockRate)));
|
||||
AddStep($"set audio offset to {userOffset}", () => localConfig.SetValue(OsuSetting.AudioOffset, userOffset));
|
||||
|
||||
AddStep("seek to 2500", () => gcc.Seek(2500));
|
||||
AddAssert("gameplay clock time = 2500", () => Precision.AlmostEquals(gcc.CurrentTime, 2500, 10f));
|
||||
AddStep("seek to 2500", () => gameplayClockContainer.Seek(2500));
|
||||
AddAssert("gameplay clock time = 2500", () => Precision.AlmostEquals(gameplayClockContainer.CurrentTime, 2500, 10f));
|
||||
|
||||
AddStep("seek to 10000", () => gcc.Seek(10000));
|
||||
AddAssert("gameplay clock time = 10000", () => Precision.AlmostEquals(gcc.CurrentTime, 10000, 10f));
|
||||
AddStep("seek to 10000", () => gameplayClockContainer.Seek(10000));
|
||||
AddAssert("gameplay clock time = 10000", () => Precision.AlmostEquals(gameplayClockContainer.CurrentTime, 10000, 10f));
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
Loading…
Reference in New Issue
Block a user