Adjust variables slightly for readability

This commit is contained in:
Dean Herbert 2022-09-21 01:29:12 +09:00
parent 979f7f88a1
commit cb8ed1f144
1 changed files with 11 additions and 6 deletions

View File

@ -106,18 +106,23 @@ public void TestCatcherAnimationStateReverted()
public void TestCatcherCatchWidth()
{
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("move catcher to center", () => catcher.X = CatchPlayfield.CENTER_X);
float leftPlateBounds = CatchPlayfield.CENTER_X - halfWidth;
float rightPlateBounds = CatchPlayfield.CENTER_X + halfWidth;
AddStep("catch fruit", () =>
{
attemptCatch(new Fruit { X = center_x + -halfWidth + 1 });
attemptCatch(new Fruit { X = center_x + halfWidth - 1 });
attemptCatch(new Fruit { X = leftPlateBounds + 1 });
attemptCatch(new Fruit { X = rightPlateBounds - 1 });
});
checkPlate(2);
AddStep("miss fruit", () =>
{
attemptCatch(new Fruit { X = center_x + -halfWidth - 1 });
attemptCatch(new Fruit { X = center_x + halfWidth + 1 });
attemptCatch(new Fruit { X = leftPlateBounds - 1 });
attemptCatch(new Fruit { X = rightPlateBounds + 1 });
});
checkPlate(2);
}