diff --git a/lib/game/bloc/game_state.dart b/lib/game/bloc/game_state.dart index 651b5ff7..d0311442 100644 --- a/lib/game/bloc/game_state.dart +++ b/lib/game/bloc/game_state.dart @@ -23,14 +23,12 @@ enum GameBonus { enum GameStatus { waiting, playing, - replaying, gameOver, } extension GameStatusX on GameStatus { bool get isWaiting => this == GameStatus.waiting; - bool get isPlaying => - this == GameStatus.playing || this == GameStatus.replaying; + bool get isPlaying => this == GameStatus.playing; bool get isGameOver => this == GameStatus.gameOver; } diff --git a/lib/game/components/backbox/backbox.dart b/lib/game/components/backbox/backbox.dart index 10f1cbb8..695eed09 100644 --- a/lib/game/components/backbox/backbox.dart +++ b/lib/game/components/backbox/backbox.dart @@ -73,7 +73,7 @@ class Backbox extends PositionComponent with ZIndex { InfoDisplay( onShare: () { _bloc.add( - ScoreShareRequested( + ShareScoreRequested( score: state.score, initials: state.initials, character: state.character, diff --git a/lib/game/components/backbox/bloc/backbox_bloc.dart b/lib/game/components/backbox/bloc/backbox_bloc.dart index d073434b..557994ca 100644 --- a/lib/game/components/backbox/bloc/backbox_bloc.dart +++ b/lib/game/components/backbox/bloc/backbox_bloc.dart @@ -18,7 +18,7 @@ class BackboxBloc extends Bloc { super(LoadingState()) { on(_onPlayerInitialsRequested); on(_onPlayerInitialsSubmitted); - on(_onScoreShareRequested); + on(_onScoreShareRequested); } final LeaderboardRepository _leaderboardRepository; @@ -62,7 +62,7 @@ class BackboxBloc extends Bloc { } Future _onScoreShareRequested( - ScoreShareRequested event, + ShareScoreRequested event, Emitter emit, ) async { emit( diff --git a/lib/game/components/backbox/bloc/backbox_event.dart b/lib/game/components/backbox/bloc/backbox_event.dart index 12347118..e909f34d 100644 --- a/lib/game/components/backbox/bloc/backbox_event.dart +++ b/lib/game/components/backbox/bloc/backbox_event.dart @@ -52,12 +52,12 @@ class PlayerInitialsSubmitted extends BackboxEvent { List get props => [score, initials, character]; } -/// {@template score_share_requested} +/// {@template share_score_requested} /// Event that request the user to share score and initials. /// {@endtemplate} -class ScoreShareRequested extends BackboxEvent { - /// {@macro score_share_requested} - const ScoreShareRequested({ +class ShareScoreRequested extends BackboxEvent { + /// {@macro share_score_requested} + const ShareScoreRequested({ required this.score, required this.initials, required this.character, diff --git a/lib/game/components/game_bloc_status_listener.dart b/lib/game/components/game_bloc_status_listener.dart index 396eac5a..6e11f3d6 100644 --- a/lib/game/components/game_bloc_status_listener.dart +++ b/lib/game/components/game_bloc_status_listener.dart @@ -22,9 +22,6 @@ class GameBlocStatusListener extends Component readProvider().play(PinballAudio.backgroundMusic); gameRef.overlays.remove(PinballGame.playButtonOverlay); break; - case GameStatus.replaying: - gameRef.overlays.remove(PinballGame.replayButtonOverlay); - break; case GameStatus.gameOver: readProvider().play(PinballAudio.gameOverVoiceOver); gameRef.descendants().whereType().first.requestInitials( diff --git a/test/game/components/backbox/backbox_test.dart b/test/game/components/backbox/backbox_test.dart index 2a351979..79069110 100644 --- a/test/game/components/backbox/backbox_test.dart +++ b/test/game/components/backbox/backbox_test.dart @@ -260,7 +260,7 @@ void main() { verify( () => bloc.add( - ScoreShareRequested( + ShareScoreRequested( score: state.score, initials: state.initials, character: state.character, diff --git a/test/game/components/backbox/bloc/backbox_bloc_test.dart b/test/game/components/backbox/bloc/backbox_bloc_test.dart index bdc9233a..13fc1ed0 100644 --- a/test/game/components/backbox/bloc/backbox_bloc_test.dart +++ b/test/game/components/backbox/bloc/backbox_bloc_test.dart @@ -100,7 +100,7 @@ void main() { }, build: () => BackboxBloc(leaderboardRepository: leaderboardRepository), act: (bloc) => bloc.add( - ScoreShareRequested( + ShareScoreRequested( score: 100, initials: 'AAA', character: AndroidTheme(), diff --git a/test/game/components/backbox/bloc/backbox_event_test.dart b/test/game/components/backbox/bloc/backbox_event_test.dart index 42231a18..b4ec2395 100644 --- a/test/game/components/backbox/bloc/backbox_event_test.dart +++ b/test/game/components/backbox/bloc/backbox_event_test.dart @@ -126,7 +126,7 @@ void main() { group('ScoreShareRequested', () { test('can be instantiated', () { expect( - ScoreShareRequested( + ShareScoreRequested( score: 0, initials: 'AAA', character: AndroidTheme(), @@ -137,13 +137,13 @@ void main() { test('supports value comparison', () { expect( - ScoreShareRequested( + ShareScoreRequested( score: 0, initials: 'AAA', character: AndroidTheme(), ), equals( - ScoreShareRequested( + ShareScoreRequested( score: 0, initials: 'AAA', character: AndroidTheme(), @@ -152,14 +152,14 @@ void main() { ); expect( - ScoreShareRequested( + ShareScoreRequested( score: 0, initials: 'AAA', character: AndroidTheme(), ), isNot( equals( - ScoreShareRequested( + ShareScoreRequested( score: 1, initials: 'AAA', character: AndroidTheme(), @@ -169,14 +169,14 @@ void main() { ); expect( - ScoreShareRequested( + ShareScoreRequested( score: 0, initials: 'AAA', character: AndroidTheme(), ), isNot( equals( - ScoreShareRequested( + ShareScoreRequested( score: 0, initials: 'AAA', character: SparkyTheme(), @@ -186,14 +186,14 @@ void main() { ); expect( - ScoreShareRequested( + ShareScoreRequested( score: 0, initials: 'AAA', character: AndroidTheme(), ), isNot( equals( - ScoreShareRequested( + ShareScoreRequested( score: 0, initials: 'BBB', character: AndroidTheme(), diff --git a/test/game/components/backbox/displays/info_display_test.dart b/test/game/components/backbox/displays/info_display_test.dart index dd99adbc..d1e72fc6 100644 --- a/test/game/components/backbox/displays/info_display_test.dart +++ b/test/game/components/backbox/displays/info_display_test.dart @@ -98,7 +98,7 @@ void main() { ); flameTester.testGameWidget( - 'calls onNavigate when Go to IO link is tapped', + 'calls onNavigate when go to IO link is tapped', setUp: (game, tester) async { var tapped = false; @@ -108,10 +108,10 @@ void main() { ); await game.pump(component); - final gotoLink = - component.descendants().whereType().first; + final googleLink = + component.descendants().whereType().first; - gotoLink.onTapDown(tapDownInfo); + googleLink.onTapDown(tapDownInfo); expect(tapped, isTrue); },