mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 23:57:25 +08:00
Fix mania hitobject tests
This commit is contained in:
parent
cab294ffa6
commit
f9af24df23
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
{
|
{
|
||||||
c.Add(CreateHitObject().With(h =>
|
c.Add(CreateHitObject().With(h =>
|
||||||
{
|
{
|
||||||
h.HitObject.StartTime = START_TIME;
|
h.HitObject.StartTime = Time.Current + 5000;
|
||||||
h.AccentColour.Value = Color4.Orange;
|
h.AccentColour.Value = Color4.Orange;
|
||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
{
|
{
|
||||||
c.Add(CreateHitObject().With(h =>
|
c.Add(CreateHitObject().With(h =>
|
||||||
{
|
{
|
||||||
h.HitObject.StartTime = START_TIME;
|
h.HitObject.StartTime = Time.Current + 5000;
|
||||||
h.AccentColour.Value = Color4.Orange;
|
h.AccentColour.Value = Color4.Orange;
|
||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
|
@ -19,8 +19,6 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class ManiaSkinnableTestScene : SkinnableTestScene
|
public abstract class ManiaSkinnableTestScene : SkinnableTestScene
|
||||||
{
|
{
|
||||||
protected const double START_TIME = 1000000000;
|
|
||||||
|
|
||||||
[Cached(Type = typeof(IScrollingInfo))]
|
[Cached(Type = typeof(IScrollingInfo))]
|
||||||
private readonly TestScrollingInfo scrollingInfo = new TestScrollingInfo();
|
private readonly TestScrollingInfo scrollingInfo = new TestScrollingInfo();
|
||||||
|
|
||||||
@ -55,27 +53,8 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
|||||||
public readonly Bindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
|
public readonly Bindable<ScrollingDirection> Direction = new Bindable<ScrollingDirection>();
|
||||||
|
|
||||||
IBindable<ScrollingDirection> IScrollingInfo.Direction => Direction;
|
IBindable<ScrollingDirection> IScrollingInfo.Direction => Direction;
|
||||||
IBindable<double> IScrollingInfo.TimeRange { get; } = new Bindable<double>(1000);
|
IBindable<double> IScrollingInfo.TimeRange { get; } = new Bindable<double>(5000);
|
||||||
IScrollAlgorithm IScrollingInfo.Algorithm { get; } = new ZeroScrollAlgorithm();
|
IScrollAlgorithm IScrollingInfo.Algorithm { get; } = new ConstantScrollAlgorithm();
|
||||||
}
|
|
||||||
|
|
||||||
private class ZeroScrollAlgorithm : IScrollAlgorithm
|
|
||||||
{
|
|
||||||
public double GetDisplayStartTime(double originTime, float offset, double timeRange, float scrollLength)
|
|
||||||
=> double.MinValue;
|
|
||||||
|
|
||||||
public float GetLength(double startTime, double endTime, double timeRange, float scrollLength)
|
|
||||||
=> scrollLength;
|
|
||||||
|
|
||||||
public float PositionAt(double time, double currentTime, double timeRange, float scrollLength)
|
|
||||||
=> (float)((time - START_TIME) / timeRange) * scrollLength;
|
|
||||||
|
|
||||||
public double TimeAt(float position, double currentTime, double timeRange, float scrollLength)
|
|
||||||
=> 0;
|
|
||||||
|
|
||||||
public void Reset()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user