private void StorePreviousTurn() { _redoTurns.Clear(); int[] array = new int[CellValue.Length]; CellValue.CopyTo(array, 0); _previousTurns.Push(array); }
public void GoBack() { if (_redoTurns.Count == 0) { int[] array = new int[CellValue.Length]; CellValue.CopyTo(array, 0); _redoTurns.Push(array); } if (_previousTurns.Count > 0) { int[] replacement = _previousTurns.Pop(); replacement.CopyTo(CellValue, 0); _redoTurns.Push(replacement); } }