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