|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsmithers.logicpuzzles.MosaicState
public class MosaicState
Represents a state of a mosaic puzzle.
| Constructor Summary | |
|---|---|
MosaicState(Mosaic puzzle)
Constructs a state for the specified puzzle. |
|
| Method Summary | |
|---|---|
void |
clearState()
Clears the state of the puzzle. |
Mosaic |
getPuzzle()
Returns the puzzle which this is a state of. |
int |
getState(int row,
int column)
Gets the state of the specified cell. |
boolean |
isSolved()
Determines whether or not the puzzle has been completely solved. |
void |
setState(int row,
int column,
int state)
Adds to the attempt at solving the puzzle. |
java.lang.String |
toString()
Generates a String representing the current situation of the
puzzle. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MosaicState(Mosaic puzzle)
puzzle - the puzzle that this is a state of| Method Detail |
|---|
public Mosaic getPuzzle()
PuzzleState
getPuzzle in interface PuzzleState<Mosaic>Puzzle which this PuzzleState relates to.
public int getState(int row,
int column)
row - the row index (from 0)column - the column index (from 0)
public void setState(int row,
int column,
int state)
row - the row index (from 0)column - the column index (from 0)state - 1 to set coloured, 0 for not coloured, or -1 to resetpublic void clearState()
public boolean isSolved()
PuzzleState
isSolved in interface PuzzleState<Mosaic>true iff the puzzle has been completely solvedpublic java.lang.String toString()
String representing the current situation of the
puzzle. Represents filled as '#', unfilled as '.' and unsure as ' '.
toString in interface PuzzleState<Mosaic>toString in class java.lang.ObjectString representing the state
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||