public class Corner
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private ColorsEnum |
color1
First color of the corner.
|
private ColorsEnum |
color2
Second color of the corner.
|
private ColorsEnum |
color3
Third color of the corner.
|
private FacesEnum |
face1
First face that the corner is on.
|
private FacesEnum |
face2
Second face that the corner is on.
|
private FacesEnum |
face3
Third face that the corner is on.
|
Constructor and Description |
---|
Corner(ColorsEnum[][] cube,
FacesEnum face1,
int index1,
FacesEnum face2,
int index2,
FacesEnum face3,
int index3)
Constructor that reads faces of the corner from parameters and colors of the corner from the elements array of the Rubik's Cube.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasColor(ColorsEnum color)
Checks if corner has an element with given color.
|
boolean |
onFace(FacesEnum face)
Checks if corner is on given face.
|
private ColorsEnum color1
private ColorsEnum color2
private ColorsEnum color3
private FacesEnum face1
private FacesEnum face2
private FacesEnum face3
Corner(ColorsEnum[][] cube, FacesEnum face1, int index1, FacesEnum face2, int index2, FacesEnum face3, int index3)
cube
- Elements array of the Rubik's Cube.face1
- First face that the corner is on.index1
- Number of element on face1 that belongs to corner.face2
- Second face that the corner is on.index2
- Number of element on face2 that belongs to corner.face3
- Third face that the corner is on.index3
- Number of element on face3 that belongs to corner.public boolean hasColor(ColorsEnum color)
color
- Color of elementpublic boolean onFace(FacesEnum face)
face
- Face of the Rubik's Cube.