|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface TwistyPuzzle
Represents a twisty puzzle such as a Rubik's Cube. In all of the methods in
this, a getColor(int) method
should return the same values as before, but getPolygon(int) method
will not. If a puzzle has unstickered faces, it should declare those as
having stickers with a transparent colour.
| Method Summary | |
|---|---|
int |
getColor(int index)
Gets the colour of the specified sticker. |
Polygon3D |
getPolygon(int index)
Gets the 3-d polygon associated with the specified sticker. |
double |
getScale()
Returns the absolute scale of the 3-d model of the puzzle. |
Twist |
getTwist(int index,
int dir)
Gets the twist instance determined by the sticker clicked on, and the directon to twist. |
boolean |
isSolved()
Works out whether this puzzle is in the solved state. |
void |
scramble()
Scrambles the puzzle. |
int |
stickerCount()
Gets the number of stickers on the puzzle. |
void |
twist(Twist twist)
Applies a twist. |
| Method Detail |
|---|
int stickerCount()
int getColor(int index)
index - the sticker index
double getScale()
Polygon3D getPolygon(int index)
index - the sticker index
Twist getTwist(int index,
int dir)
twist(smithers.twisty.Twist) (i.e. will not throw
ClassCastException, although the move may not be possible). The
dir argument should be: 0 for anticlockwise, 1 for clockwise or
2 for a half twist.
index - the sticker which was clicked ondir - the directon
void twist(Twist twist)
twist - the twistvoid scramble()
boolean isSolved()
true iff the puzzle is solved
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||