From 5bbfd0c3628a978ea2aaf0159f3f50087ac5c451 Mon Sep 17 00:00:00 2001 From: Alejandro Santiago Date: Wed, 23 Mar 2022 16:19:44 +0000 Subject: [PATCH] refactor: made Pathway createFixtureDefs public (#81) * refactor: made createFixtureDefs public --- lib/game/components/pathway.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/game/components/pathway.dart b/lib/game/components/pathway.dart index 0c29dd7b..8604e0f3 100644 --- a/lib/game/components/pathway.dart +++ b/lib/game/components/pathway.dart @@ -146,7 +146,8 @@ class Pathway extends BodyComponent with InitialPosition, Layered { final List> _paths; - List _createFixtureDefs() { + /// Constructs different [ChainShape]s to form the [Pathway] shape. + List createFixtureDefs() { final fixturesDef = []; for (final path in _paths) { @@ -161,7 +162,7 @@ class Pathway extends BodyComponent with InitialPosition, Layered { Body createBody() { final bodyDef = BodyDef()..position = initialPosition; final body = world.createBody(bodyDef); - _createFixtureDefs().forEach(body.createFixture); + createFixtureDefs().forEach(body.createFixture); return body; }