|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPrintGame.Cell
A cell that is used in the labyrinth
Field Summary | |
protected int |
cell_mark_
|
protected static int |
CONTAINS_DIAMOND
|
protected static int |
EMPTY
|
protected static int |
STARTPOINT
|
protected int |
status_
member variable to store the flags in |
protected static int |
WALL
status flags |
protected static int |
WAY
|
Constructor Summary | |
Cell()
find out whether the cell is a wall |
Method Summary | |
boolean |
containsDiamond()
find out whether the cell contains a diamand |
void |
convertToStartpoint()
covert a cell to a startpoint |
void |
convertToWall()
covert a way or a empty cell to wall |
void |
convertToWay()
covert a cell to a way |
int |
getCellMark()
|
boolean |
isEmpty()
|
boolean |
isStartpoint()
find out whether the cell is a startpoint |
boolean |
isWall()
find out whether the cell is a wall |
boolean |
isWay()
find out whether the cell is a way |
void |
removeDiamond()
remove a diamond |
void |
removeStartpoint()
remove a startpoint |
void |
resetAll()
resets the cell including status |
void |
setCellMark(int cell_mark)
|
void |
setDiamond()
set a diamand |
void |
setEmpty()
|
java.lang.String |
toString()
standard toString method for debugging |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final int WALL
protected static final int WAY
protected static final int STARTPOINT
protected static final int CONTAINS_DIAMOND
protected static final int EMPTY
protected int status_
protected int cell_mark_
Constructor Detail |
public Cell()
Method Detail |
public void setCellMark(int cell_mark)
public int getCellMark()
public boolean isWall()
public void convertToWall() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- thrown if the cell is allready
a wall, the cell contains a diamond or a robot.public boolean isWay()
public void convertToWay() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- thrown if the cell is allready
a way.public boolean isStartpoint()
public void convertToStartpoint() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- thrown if the cell is allready
a startpoint.public void removeStartpoint() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- thrown when trying to remove a
startpoint form a cell that doesn't contain a startpointpublic boolean containsDiamond()
public void setDiamond() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- thrown when trying to place a
diamond in a cell that already contains a diamondpublic boolean isEmpty()
public void removeDiamond() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- thrown when trying to remove a
diamond form a cell that doesn't contain a diamondpublic void resetAll()
public void setEmpty() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |