From 636d275ca96c5de7ff78646d1e0c50ca35317c11 Mon Sep 17 00:00:00 2001 From: alestiago Date: Thu, 5 May 2022 17:38:31 +0100 Subject: [PATCH] refactor: defined in line --- .../behaviors/camera_focusing_behavior.dart | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/game/behaviors/camera_focusing_behavior.dart b/lib/game/behaviors/camera_focusing_behavior.dart index adcafa3d..04f85cfd 100644 --- a/lib/game/behaviors/camera_focusing_behavior.dart +++ b/lib/game/behaviors/camera_focusing_behavior.dart @@ -25,7 +25,7 @@ class FocusData { /// Changes the game focus when the [GameBloc] status changes. class CameraFocusingBehavior extends Component with ParentIsA, BlocComponent { - final Map _foci = {}; + late final Map _foci; @override bool listenWhen(GameState? previousState, GameState newState) { @@ -49,18 +49,20 @@ class CameraFocusingBehavior extends Component @override Future onLoad() async { await super.onLoad(); - _foci['game'] = FocusData( - zoom: parent.size.y / 16, - position: Vector2(0, -7.8), - ); - _foci['waiting'] = FocusData( - zoom: parent.size.y / 18, - position: Vector2(0, -112), - ); - _foci['backbox'] = FocusData( - zoom: parent.size.y / 10, - position: Vector2(0, -111), - ); + _foci = { + 'game': FocusData( + zoom: parent.size.y / 16, + position: Vector2(0, -7.8), + ), + 'waiting': FocusData( + zoom: parent.size.y / 18, + position: Vector2(0, -112), + ), + 'gameOver': FocusData( + zoom: parent.size.y / 10, + position: Vector2(0, -111), + ), + }; _snap(_foci['waiting']!); }