Rename grid snapping methods

This commit is contained in:
smoogipoo
2019-10-24 18:17:54 +09:00
parent f45f17339c
commit d83b9ef0e4
5 changed files with 12 additions and 12 deletions

View File

@ -106,10 +106,10 @@ namespace osu.Game.Tests.Visual.Editor
Vector2 snapPosition = Vector2.Zero;
AddStep("get first tick position", () => snapPosition = grid_position + new Vector2((float)beat_length, 0));
AddAssert("snap time is 1 beat away", () => Precision.AlmostEquals(beat_length, grid.GetSnapTime(snapPosition), 0.01));
AddAssert("snap time is 1 beat away", () => Precision.AlmostEquals(beat_length, grid.GetSnappedTime(snapPosition), 0.01));
createGrid(g => g.Velocity = 2, "with velocity = 2");
AddAssert("snap time is now 0.5 beats away", () => Precision.AlmostEquals(beat_length / 2, grid.GetSnapTime(snapPosition), 0.01));
AddAssert("snap time is now 0.5 beats away", () => Precision.AlmostEquals(beat_length / 2, grid.GetSnappedTime(snapPosition), 0.01));
}
private void createGrid(Action<TestDistanceSnapGrid> func = null, string description = null)
@ -206,7 +206,7 @@ namespace osu.Game.Tests.Visual.Editor
protected override float GetVelocity(double time, ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
=> Velocity;
public override Vector2 GetSnapPosition(Vector2 screenSpacePosition)
public override Vector2 GetSnappedPosition(Vector2 screenSpacePosition)
=> Vector2.Zero;
}
}