[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
@@ -20,7 +20,7 @@ namespace Minesweeper.Presentation.ReadModels
public int Width => boardService.Width > 0 ? boardService.Width : settingsService.SizeX;
public int Height => boardService.Height > 0 ? boardService.Height : settingsService.SizeY;
public int MinesCount => boardService.MinesCount > 0 ? boardService.MinesCount : settingsService.MinesCount;
public int FlaggedCellsCount => CountFlaggedCells();
public int FlaggedCellsCount => boardService.FlaggedCellsCount;
public int RemainingMinesCount => MinesCount - FlaggedCellsCount;
public bool TryGetCell(int x, int y, out BoardCellData cell)
@@ -33,19 +33,10 @@ namespace Minesweeper.Presentation.ReadModels
return boardService.GetCells();
}
private int CountFlaggedCells()
public IReadOnlyList<BoardCellData> GetChangedCells()
{
var cells = boardService.GetCells();
var count = 0;
for (var i = 0; i < cells.Count; i++)
{
if (cells[i].IsFlagged)
{
count++;
}
}
return count;
return boardService.LastChangedCells;
}
}
}