From 24ac3ad323ade52da2ce64e20beeccbb713f69f7 Mon Sep 17 00:00:00 2001 From: RuiAlonso Date: Thu, 17 Mar 2022 21:20:25 +0100 Subject: [PATCH] chore: analysis error --- lib/game/components/ramp_opening.dart | 2 +- test/game/components/ramp_opening_test.dart | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/game/components/ramp_opening.dart b/lib/game/components/ramp_opening.dart index ed1cb64d..96b1ec15 100644 --- a/lib/game/components/ramp_opening.dart +++ b/lib/game/components/ramp_opening.dart @@ -80,7 +80,6 @@ class RampOpeningBallContactCallback ball.layer = layer; } else { ballsInside.remove(ball); - ball.layer = Layer.board; } } @@ -96,5 +95,6 @@ class RampOpeningBallContactCallback if (isBallOutsideOpening) ball.layer = Layer.board; */ + if (!ballsInside.contains(ball)) ball.layer = Layer.board; } } diff --git a/test/game/components/ramp_opening_test.dart b/test/game/components/ramp_opening_test.dart index 75b76e31..abd38d47 100644 --- a/test/game/components/ramp_opening_test.dart +++ b/test/game/components/ramp_opening_test.dart @@ -251,8 +251,8 @@ void main() { expect(callback.ballsInside.first, ball); // TODO(ruimiguel): check what happens with ball that slightly touch - // Opening and goes out again. With InitialPosition change now doesn't work - // position.y comparison + // Opening and goes out again. With InitialPosition change now doesn't + // work position.y comparison callback.end(ball, area, MockContact()); //expect(callback.ballsInside.isEmpty, true); }); @@ -282,8 +282,8 @@ void main() { verify(() => ball.layer = Layer.jetpack).called(1); // TODO(ruimiguel): check what happens with ball that slightly touch - // Opening and goes out again. With InitialPosition change now doesn't work - // position.y comparison + // Opening and goes out again. With InitialPosition change now doesn't + // work position.y comparison callback.end(ball, area, MockContact()); //verify(() => ball.layer = Layer.board); });