From be323c71477d009bb8bcda38560fa5c370bcd6f1 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Fri, 25 May 2018 02:14:56 +0900 Subject: [PATCH] Fix InspectCode issues. --- osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs | 3 +-- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs index ed6600c55d..511cda6399 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs @@ -16,7 +16,6 @@ namespace osu.Game.Rulesets.Catch.Tests public class TestCaseCatcherArea : OsuTestCase { private RulesetInfo catchRuleset; - private TestCatcherArea catcherArea; public override IReadOnlyList RequiredTypes => new[] { @@ -33,7 +32,7 @@ namespace osu.Game.Rulesets.Catch.Tests Child = new CatchInputManager(catchRuleset) { RelativeSizeAxes = Axes.Both, - Child = catcherArea = new TestCatcherArea(new BeatmapDifficulty { CircleSize = size }) + Child = new TestCatcherArea(new BeatmapDifficulty { CircleSize = size }) { Anchor = Anchor.CentreLeft, Origin = Anchor.BottomLeft diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 56826d228c..d57d52cf5f 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -255,7 +255,7 @@ namespace osu.Game.Rulesets.Catch.UI HyperDashing = true; hyperDashModifier = Math.Abs(velocity); - hyperDashDirection = (int)Math.Sign(velocity); + hyperDashDirection = Math.Sign(velocity); hyperDashTargetPosition = target.X; } else @@ -267,9 +267,9 @@ namespace osu.Game.Rulesets.Catch.UI } private double hyperDashModifier = 1; - private int hyperDashDirection = 0; + private int hyperDashDirection; private float hyperDashTargetPosition; - private bool hyperDashing = false; + private bool hyperDashing; /// /// Whether we are hypderdashing or not. @@ -361,8 +361,8 @@ namespace osu.Game.Rulesets.Catch.UI X = (float)MathHelper.Clamp(X + direction * Clock.ElapsedFrameTime * speed, 0, 1); // Correct overshooting. - if ((hyperDashDirection > 0 && hyperDashTargetPosition < X) || - (hyperDashDirection < 0 && hyperDashTargetPosition > X)) + if (hyperDashDirection > 0 && hyperDashTargetPosition < X || + hyperDashDirection < 0 && hyperDashTargetPosition > X) { X = hyperDashTargetPosition; HyperDashing = false;