private void Redraw(IGameHandler handler) { handler.Clear(); foreach (var cell in _cells.AsEnumerable()) { int i = cell.Key.Item1 - _players[0].ViewportLeft; int j = cell.Key.Item2 - _players[0].ViewportTop; if (0 > i || i >= CellsCount || 0 > j || j >= CellsCount) { continue; } if (cell.Value == CellType.X) { handler.DrawX(i, j); } else { handler.DrawZero(i, j); } } }