protected static void SwapRowColors(CubeRow sourceRow, CubeRow destinationRow) { for (var index = 0; index < destinationRow.Facelets.Count; index++) { destinationRow.Facelets[index].CurrentColor = sourceRow.Facelets[index].CurrentColor; } }
protected static void RotateRowsOfAdjacentFacesClockwise(CubeRow topRow, CubeRow bottomRow, CubeRow leftRow, CubeRow rightRow) { var bufferRow = rightRow.DeepClone(); SwapRowColors(topRow, rightRow); SwapRowColorsAndOrder(leftRow, topRow); SwapRowColors(bottomRow, leftRow); SwapRowColorsAndOrder(bufferRow, bottomRow); }
protected static void SwapRowColorsAndOrder(CubeRow sourceRow, CubeRow destinationRow) { for (var index = 0; index < destinationRow.Facelets.Count; index++) { var destinationIndex = (destinationRow.Facelets.Count - 1) - index; destinationRow.Facelets[destinationIndex].CurrentColor = sourceRow.Facelets[index].CurrentColor; } }
public abstract void RotateCounterClockwise(CubeRow topRow, CubeRow bottomRow, CubeRow leftRow, CubeRow rightRow);