refactor: renamed params

pull/84/head
RuiAlonso 4 years ago
commit 27395c5acc

@ -146,7 +146,7 @@ class Pathway extends BodyComponent with InitialPosition, Layered {
/// Creates an ellipse [Pathway]. /// Creates an ellipse [Pathway].
/// ///
/// Does so with two [ChainShape] separated by a [width]. Can /// Does so with two [ChainShape]s separated by a [width]. Can
/// be rotated by a given [rotation] in radians. /// be rotated by a given [rotation] in radians.
/// ///
/// If [singleWall] is true, just one [ChainShape] is created. /// If [singleWall] is true, just one [ChainShape] is created.
@ -154,8 +154,8 @@ class Pathway extends BodyComponent with InitialPosition, Layered {
Color? color, Color? color,
required Vector2 center, required Vector2 center,
required double width, required double width,
required double bigRadius, required double majorRadius,
required double smallRadius, required double minorRadius,
double rotation = 0, double rotation = 0,
bool singleWall = false, bool singleWall = false,
}) { }) {
@ -164,16 +164,16 @@ class Pathway extends BodyComponent with InitialPosition, Layered {
// TODO(ruialonso): Refactor repetitive logic // TODO(ruialonso): Refactor repetitive logic
final outerWall = calculateEllipse( final outerWall = calculateEllipse(
center: center, center: center,
majorRadius: bigRadius, majorRadius: majorRadius,
minorRadius: smallRadius, minorRadius: minorRadius,
).map((vector) => vector..rotate(rotation)).toList(); ).map((vector) => vector..rotate(rotation)).toList();
paths.add(outerWall); paths.add(outerWall);
if (!singleWall) { if (!singleWall) {
final innerWall = calculateEllipse( final innerWall = calculateEllipse(
center: center, center: center,
majorRadius: bigRadius - width, majorRadius: majorRadius - width,
minorRadius: smallRadius - width, minorRadius: minorRadius - width,
).map((vector) => vector..rotate(rotation)).toList(); ).map((vector) => vector..rotate(rotation)).toList();
paths.add(innerWall); paths.add(innerWall);
} }

Loading…
Cancel
Save