[Fix] Fix Smile Pause
This commit is contained in:
@@ -130,7 +130,7 @@ namespace Minesweeper.Presentation.Presenters
|
||||
|
||||
private void OnPauseChanged(bool isPaused)
|
||||
{
|
||||
if (isPaused && gameStateService.Current == GameState.Playing)
|
||||
if (isPaused && CanPause(gameStateService.Current))
|
||||
{
|
||||
pauseView.Show();
|
||||
}
|
||||
@@ -189,5 +189,10 @@ namespace Minesweeper.Presentation.Presenters
|
||||
{
|
||||
commandDispatcher.Dispatch(new PauseCommand());
|
||||
}
|
||||
|
||||
private static bool CanPause(GameState state)
|
||||
{
|
||||
return state == GameState.Preparing || state == GameState.Playing;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,11 +75,11 @@ namespace Minesweeper.Presentation.Presenters
|
||||
{
|
||||
commandDispatcher.Dispatch(new StartGameCommand());
|
||||
}
|
||||
else if (state == GameState.Playing && !pauseService.IsPaused)
|
||||
else if (CanPause(state) && !pauseService.IsPaused)
|
||||
{
|
||||
commandDispatcher.Dispatch(new PauseCommand());
|
||||
}
|
||||
else if (state == GameState.Playing && pauseService.IsPaused)
|
||||
else if (CanPause(state) && pauseService.IsPaused)
|
||||
{
|
||||
commandDispatcher.Dispatch(new ResumeCommand());
|
||||
}
|
||||
@@ -126,5 +126,10 @@ namespace Minesweeper.Presentation.Presenters
|
||||
|
||||
return SmileFaceState.Smile;
|
||||
}
|
||||
|
||||
private static bool CanPause(GameState state)
|
||||
{
|
||||
return state == GameState.Preparing || state == GameState.Playing;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user