private void SaveState() { var state = new CanvasCell[Width, Height]; Array.Copy(Cells, state, Cells.Length); _previousStates.Push(state); }
private void Initialize(ICanvasDimentions canvasSize) { Cells = new CanvasCell[canvasSize.Width, canvasSize.Height]; for (var i = 0; i < canvasSize.Width; i++) { for (var j = 0; j < canvasSize.Height; j++) { Cells[i, j] = new CanvasCell(CanvasCellContentType.Empty, ' '); } } }
private void DrawPoint(Point point) { var cellContent = new CanvasCell(CanvasCellContentType.Line, 'x'); Cells[point.X, point.Y] = cellContent; }