mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 22:33:05 +08:00
Fixed TestCatcherWidth and added TestFruitClampedToCatchableRegion
This commit is contained in:
parent
50c973a8e3
commit
979f7f88a1
@ -106,20 +106,32 @@ namespace osu.Game.Rulesets.Catch.Tests
|
|||||||
public void TestCatcherCatchWidth()
|
public void TestCatcherCatchWidth()
|
||||||
{
|
{
|
||||||
float halfWidth = Catcher.CalculateCatchWidth(new BeatmapDifficulty { CircleSize = 0 }) / 2;
|
float halfWidth = Catcher.CalculateCatchWidth(new BeatmapDifficulty { CircleSize = 0 }) / 2;
|
||||||
|
const float center_x = CatchPlayfield.CENTER_X;
|
||||||
|
AddStep("move catcher to center", () => catcher.X = center_x);
|
||||||
AddStep("catch fruit", () =>
|
AddStep("catch fruit", () =>
|
||||||
{
|
{
|
||||||
attemptCatch(new Fruit { X = -halfWidth + 1 });
|
attemptCatch(new Fruit { X = center_x + -halfWidth + 1 });
|
||||||
attemptCatch(new Fruit { X = halfWidth - 1 });
|
attemptCatch(new Fruit { X = center_x + halfWidth - 1 });
|
||||||
});
|
});
|
||||||
checkPlate(2);
|
checkPlate(2);
|
||||||
AddStep("miss fruit", () =>
|
AddStep("miss fruit", () =>
|
||||||
{
|
{
|
||||||
attemptCatch(new Fruit { X = -halfWidth - 1 });
|
attemptCatch(new Fruit { X = center_x + -halfWidth - 1 });
|
||||||
attemptCatch(new Fruit { X = halfWidth + 1 });
|
attemptCatch(new Fruit { X = center_x + halfWidth + 1 });
|
||||||
});
|
});
|
||||||
checkPlate(2);
|
checkPlate(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestFruitClampedToCatchableRegion()
|
||||||
|
{
|
||||||
|
AddStep("catch fruit left", () => attemptCatch(new Fruit { X = -CatchPlayfield.WIDTH }));
|
||||||
|
checkPlate(1);
|
||||||
|
AddStep("move catcher to right", () => catcher.X = CatchPlayfield.WIDTH);
|
||||||
|
AddStep("catch fruit right", () => attemptCatch(new Fruit { X = CatchPlayfield.WIDTH * 2 }));
|
||||||
|
checkPlate(2);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFruitChangesCatcherState()
|
public void TestFruitChangesCatcherState()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user