From ab359aafb5d5869fdad443f0e5e90f5b7868e5f1 Mon Sep 17 00:00:00 2001 From: Erick Zanardo Date: Wed, 9 Mar 2022 14:19:09 -0300 Subject: [PATCH] feat: pr suggestions --- lib/game/bloc/game_bloc.dart | 2 +- lib/game/bloc/game_state.dart | 14 ++++++++------ test/game/bloc/game_bloc_test.dart | 2 +- test/game/bloc/game_state_test.dart | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/game/bloc/game_bloc.dart b/lib/game/bloc/game_bloc.dart index 554c6eb1..c5cf88d3 100644 --- a/lib/game/bloc/game_bloc.dart +++ b/lib/game/bloc/game_bloc.dart @@ -38,7 +38,7 @@ class GameBloc extends Bloc { activatedBonusLetters: [], bonusHistory: [ ...state.bonusHistory, - GameBonuses.letterSequence, + GameBonus.letterSequence, ], ), ); diff --git a/lib/game/bloc/game_state.dart b/lib/game/bloc/game_state.dart index c64a5178..3cabcd49 100644 --- a/lib/game/bloc/game_state.dart +++ b/lib/game/bloc/game_state.dart @@ -1,7 +1,9 @@ part of 'game_bloc.dart'; -/// Defines bonuses that a player can gain during a [PinballGame]. -enum GameBonuses { +/// Defines bonuses that a player can gain during a PinballGame. +enum GameBonus { + /// Bonus achieved when the user activate all of the bonus + /// letters on the board letterSequence, } @@ -35,9 +37,9 @@ class GameState extends Equatable { /// Active bonus letters. final List activatedBonusLetters; - /// Holds the history of all the [GameBonus]es earned by the player during a - /// [PinballGame]. - final List bonusHistory; + /// Holds the history of all the [GameBonus]es earned by the player during a + /// PinballGame. + final List bonusHistory; /// Determines when the game is over. bool get isGameOver => balls == 0; @@ -49,7 +51,7 @@ class GameState extends Equatable { int? score, int? balls, List? activatedBonusLetters, - List? bonusHistory, + List? bonusHistory, }) { assert( score == null || score >= this.score, diff --git a/test/game/bloc/game_bloc_test.dart b/test/game/bloc/game_bloc_test.dart index d15392eb..cd3fa0cc 100644 --- a/test/game/bloc/game_bloc_test.dart +++ b/test/game/bloc/game_bloc_test.dart @@ -154,7 +154,7 @@ void main() { score: 0, balls: 3, activatedBonusLetters: [], - bonusHistory: [GameBonuses.letterSequence], + bonusHistory: [GameBonus.letterSequence], ), ], ); diff --git a/test/game/bloc/game_state_test.dart b/test/game/bloc/game_state_test.dart index 26f34aee..501310c6 100644 --- a/test/game/bloc/game_state_test.dart +++ b/test/game/bloc/game_state_test.dart @@ -175,7 +175,7 @@ void main() { score: gameState.score + 1, balls: gameState.balls + 1, activatedBonusLetters: const [0], - bonusHistory: const [GameBonuses.letterSequence], + bonusHistory: const [GameBonus.letterSequence], ); expect(gameState, isNot(equals(otherGameState)));