[Fix] ECS

This commit is contained in:
2026-06-07 01:12:10 +07:00
parent 285c11597a
commit 5a58c9031a
16 changed files with 225 additions and 36 deletions
@@ -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;