mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:03:21 +08:00
Move private functions in line with others
This commit is contained in:
parent
809caaa44c
commit
31cfaefdeb
@ -90,22 +90,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
assertChildPosition(5);
|
assertChildPosition(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertDead(int index) => AddAssert($"hitobject {index} is dead", () => getDrawableHitObject(index) == null);
|
|
||||||
|
|
||||||
private void assertHeight(int index) => AddAssert($"hitobject {index} height", () =>
|
|
||||||
{
|
|
||||||
var d = getDrawableHitObject(index);
|
|
||||||
return d != null && Precision.AlmostEquals(d.DrawHeight, yScale * (float)(d.HitObject.Duration / time_range), 0.1f);
|
|
||||||
});
|
|
||||||
|
|
||||||
private void assertChildPosition(int index) => AddAssert($"hitobject {index} child position", () =>
|
|
||||||
{
|
|
||||||
var d = getDrawableHitObject(index);
|
|
||||||
return d is DrawableTestParentHitObject && Precision.AlmostEquals(
|
|
||||||
d.NestedHitObjects.First().DrawPosition.Y,
|
|
||||||
yScale * (float)((TestParentHitObject)d.HitObject).ChildTimeOffset / time_range, 0.1f);
|
|
||||||
});
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestRelativeBeatLengthScaleSingleTimingPoint()
|
public void TestRelativeBeatLengthScaleSingleTimingPoint()
|
||||||
{
|
{
|
||||||
@ -220,6 +204,22 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
private float yScale => drawableRuleset.Playfield.HitObjectContainer.DrawHeight;
|
private float yScale => drawableRuleset.Playfield.HitObjectContainer.DrawHeight;
|
||||||
|
|
||||||
|
private void assertDead(int index) => AddAssert($"hitobject {index} is dead", () => getDrawableHitObject(index) == null);
|
||||||
|
|
||||||
|
private void assertHeight(int index) => AddAssert($"hitobject {index} height", () =>
|
||||||
|
{
|
||||||
|
var d = getDrawableHitObject(index);
|
||||||
|
return d != null && Precision.AlmostEquals(d.DrawHeight, yScale * (float)(d.HitObject.Duration / time_range), 0.1f);
|
||||||
|
});
|
||||||
|
|
||||||
|
private void assertChildPosition(int index) => AddAssert($"hitobject {index} child position", () =>
|
||||||
|
{
|
||||||
|
var d = getDrawableHitObject(index);
|
||||||
|
return d is DrawableTestParentHitObject && Precision.AlmostEquals(
|
||||||
|
d.NestedHitObjects.First().DrawPosition.Y,
|
||||||
|
yScale * (float)((TestParentHitObject)d.HitObject).ChildTimeOffset / time_range, 0.1f);
|
||||||
|
});
|
||||||
|
|
||||||
private void assertPosition(int index, float relativeY) => AddAssert($"hitobject {index} at {relativeY}",
|
private void assertPosition(int index, float relativeY) => AddAssert($"hitobject {index} at {relativeY}",
|
||||||
() => Precision.AlmostEquals(getDrawableHitObject(index)?.DrawPosition.Y ?? -1, yScale * relativeY));
|
() => Precision.AlmostEquals(getDrawableHitObject(index)?.DrawPosition.Y ?? -1, yScale * relativeY));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user