From 8901bcec70cebd819fc11e0d6165108c402b218b Mon Sep 17 00:00:00 2001 From: RuiAlonso Date: Mon, 7 Mar 2022 16:20:01 +0100 Subject: [PATCH] chore: var names and lambda method for identity element --- lib/game/components/path.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/game/components/path.dart b/lib/game/components/path.dart index 69b16b20..d5263024 100644 --- a/lib/game/components/path.dart +++ b/lib/game/components/path.dart @@ -32,7 +32,7 @@ class Path extends BodyComponent { required Vector2 end, required double pathWidth, double rotation = 0, - bool onlyOneWall = false, + bool singleWall = false, }) { final paths = >[]; final wall1 = [ @@ -41,7 +41,7 @@ class Path extends BodyComponent { ]; paths.add(wall1.map((e) => e..rotate(radians(rotation))).toList()); - if (!onlyOneWall) { + if (!singleWall) { final wall2 = [ start + Vector2(pathWidth, 0), end + Vector2(pathWidth, 0), @@ -72,7 +72,7 @@ class Path extends BodyComponent { required double radius, required double angle, double rotation = 0, - bool onlyOneWall = false, + bool singleWall = false, }) { final paths = >[]; @@ -84,7 +84,7 @@ class Path extends BodyComponent { ); paths.add(wall1); - if (!onlyOneWall) { + if (!singleWall) { final minRadius = radius - pathWidth; final wall2 = calculateArc( @@ -117,7 +117,7 @@ class Path extends BodyComponent { required List controlPoints, required double pathWidth, double rotation = 0, - bool onlyOneWall = false, + bool singleWall = false, }) { final paths = >[]; @@ -125,7 +125,7 @@ class Path extends BodyComponent { paths.add(wall1.map((e) => e..rotate(radians(rotation))).toList()); var wall2 = []; - if (!onlyOneWall) { + if (!singleWall) { wall2 = calculateBezierCurve( controlPoints: controlPoints .map((e) => e + Vector2(pathWidth, -pathWidth)) @@ -155,7 +155,7 @@ class Path extends BodyComponent { for (final path in _paths) { final chain = ChainShape() ..createChain( - path.map((e) => gameRef.screenToWorld(e)).toList(), + path.map(gameRef.screenToWorld).toList(), ); final fixtureDef = FixtureDef(chain); body.createFixture(fixtureDef);