|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPrintGame.Field
PrintGame.LabyrinthField
class representing a two dimensional labyrinth
Field Summary | |
protected int |
cls
|
protected java.lang.String |
name_
|
protected int |
num_diamonds_
the number of diamonds distributed in the field (set from outside of the class with the appropriate method-calls |
protected int |
num_wall_cells_
the number of none way cells e.g.way cells (set from outside of the class with the appropriate method-calls |
protected int |
num_way_cells_
the number of way cells distributed in the field (set from outside of the class with the appropriate method-calls |
protected int |
rws
|
protected Direction |
start_direction_
|
protected int |
start_point_col_
|
protected int |
start_point_row_
|
Fields inherited from class PrintGame.Field |
field_ |
Constructor Summary | |
LabyrinthField(int rows,
int cols)
Standard constructor |
Method Summary | |
java.lang.Object |
clone()
This is used to make a copy of the whole object, but unlike what one would expect from a clone() method, this one does a deep copy! |
boolean |
containsDiamond(int row,
int col)
|
void |
convertToStartpoint(int row,
int col)
|
void |
convertToWall(int row,
int col)
|
void |
convertToWay(int row,
int col)
|
int |
getCellMark(int row,
int col)
|
java.lang.String |
getName()
|
int |
getNumDiamonds()
|
int |
getNumWallCells()
|
int |
getNumWayCells()
|
Direction |
getStartDirection()
|
int |
getStartpointCol()
|
int |
getStartpointRow()
|
boolean |
isEmpty(int row,
int col)
|
boolean |
isStartDirection()
|
boolean |
isStartpoint()
|
boolean |
isStartpoint(int row,
int col)
|
boolean |
isWall(int row,
int col)
|
boolean |
isWay(int row,
int col)
|
void |
removeDiamond(int row,
int col)
|
void |
removeStartpoint(int row,
int col)
|
void |
setCellMark(int row,
int col,
int cell_mark)
Sets one of the numbers {0,1,2,3} to the cell. |
void |
setDiamond(int row,
int col)
|
void |
setEmpty(int row,
int col)
|
void |
setName(java.lang.String name)
|
void |
setStartDirection(Direction direction)
|
java.lang.String |
toString()
standard toString method for debugging |
boolean |
wereAllDiamondsFound()
package-internal method that returns if all diamonds were found according to the internal counters |
Methods inherited from class PrintGame.Field |
getNumCols, getNumRows |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int num_diamonds_
protected int num_way_cells_
protected int num_wall_cells_
protected int start_point_row_
protected int start_point_col_
protected Direction start_direction_
protected java.lang.String name_
protected int rws
protected int cls
Constructor Detail |
public LabyrinthField(int rows, int cols) throws java.lang.IllegalArgumentException
rows
- the number of rows of this labyrinthcols
- the number of columns of this labyrinth
java.lang.IllegalArgumentException
- thrown if either rows or cols
is < 0Method Detail |
public java.lang.Object clone()
LevelHandler.loadLevel(int, boolean)
public void setCellMark(int row, int col, int cell_mark) throws java.lang.IllegalArgumentException
row
- Set the cellmark to this rowcol
- Set the cellmark to this columncell_mark
- is the number to be written
java.lang.IllegalArgumentException
public void setDiamond(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setName(java.lang.String name)
public java.lang.String getName()
public void setStartDirection(Direction direction)
public void removeDiamond(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void removeStartpoint(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void convertToWay(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void convertToWall(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void convertToStartpoint(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public int getNumDiamonds()
public int getNumWayCells()
public int getNumWallCells()
public boolean isWay(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean isWall(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean isStartpoint(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean isStartpoint()
public int getCellMark(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public int getStartpointRow() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public int getStartpointCol() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public Direction getStartDirection()
public boolean isStartDirection()
public boolean containsDiamond(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean wereAllDiamondsFound()
public void setEmpty(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean isEmpty(int row, int col) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String toString()
toString
in class Field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |