public class ColorCorrector extends Object
This is how the class represent the corner:
+--------+--------+
| | |
| corner | right |
| | |
| | |
+--------+--------+
| |
| left |
| |
| |
+--------+
Whereas each of the squares above belong to another cube's face| Modifier and Type | Class and Description |
|---|---|
private static class |
ColorCorrector.Corner
This enumeration represent all corners of cube's face:
|
| Modifier and Type | Field and Description |
|---|---|
private static ColorCorrector.Corner[][] |
LEFT_CORNERS_CORNER |
private static Orientation[][] |
LEFT_CORNERS_FACE |
private static Colors[][] |
RED_ORANGE_CORNERS |
private static ColorCorrector.Corner[][] |
RIGHT_CORNERS_CORNER |
private static Orientation[][] |
RIGHT_CORNERS_FACE |
| Constructor and Description |
|---|
ColorCorrector() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static void |
fixCorners(Cube.Face[] faces)
The fix routine.
|
private static Colors |
getCornerLeftColor(Cube.Face[] faces,
Cube.Face face,
ColorCorrector.Corner corner)
Get the left color given the corner
|
private static Colors |
getCornerRightColor(Cube.Face[] faces,
Cube.Face face,
ColorCorrector.Corner corner)
Get the right color given the corner
|
private static final Colors[][] RED_ORANGE_CORNERS
private static final ColorCorrector.Corner[][] LEFT_CORNERS_CORNER
private static final Orientation[][] LEFT_CORNERS_FACE
private static final ColorCorrector.Corner[][] RIGHT_CORNERS_CORNER
private static final Orientation[][] RIGHT_CORNERS_FACE
private static Colors getCornerLeftColor(Cube.Face[] faces, Cube.Face face, ColorCorrector.Corner corner)
faces - All cube's facesface - Current face we're handlingcorner - For which corner we want its leftColorCorrector.Cornerprivate static Colors getCornerRightColor(Cube.Face[] faces, Cube.Face face, ColorCorrector.Corner corner)
faces - All cube's facesface - Current face we're handlingcorner - For which corner we want its rightColorCorrector.Cornerstatic void fixCorners(Cube.Face[] faces)
The method goes over all the cube's Red/Orange corners and fix them according to their neighbors
faces - All cube's faces