[Fix] ECS
This commit is contained in:
@@ -70,7 +70,7 @@ namespace Minesweeper.Presentation.Presenters
|
||||
{
|
||||
topPanelPresenter.SetCellPressActive(false);
|
||||
commandDispatcher.Dispatch(new OpenCellCommand(x, y));
|
||||
RefreshBoard();
|
||||
RefreshChangedCellsOrBoard();
|
||||
topPanelPresenter.RefreshCounters();
|
||||
UpdateBoardInput();
|
||||
}
|
||||
@@ -78,7 +78,7 @@ namespace Minesweeper.Presentation.Presenters
|
||||
private void OnCellFlagRequested(int x, int y)
|
||||
{
|
||||
commandDispatcher.Dispatch(new ToggleFlagCommand(x, y));
|
||||
RefreshBoard();
|
||||
RefreshChangedCellsOrBoard();
|
||||
topPanelPresenter.RefreshCounters();
|
||||
UpdateBoardInput();
|
||||
}
|
||||
@@ -156,6 +156,17 @@ namespace Minesweeper.Presentation.Presenters
|
||||
boardView.Refresh(readModel.GetCells(), IsFinalState());
|
||||
}
|
||||
|
||||
private void RefreshChangedCellsOrBoard()
|
||||
{
|
||||
if (IsFinalState())
|
||||
{
|
||||
RefreshBoard();
|
||||
return;
|
||||
}
|
||||
|
||||
boardView.RefreshCells(readModel.GetChangedCells(), false);
|
||||
}
|
||||
|
||||
private bool IsFinalState()
|
||||
{
|
||||
var state = gameStateService.Current;
|
||||
|
||||
Reference in New Issue
Block a user