|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectStrategoBoard
public class StrategoBoard
This class manages data for a 10 by 10 board of stratego pieces
Constructor Summary | |
---|---|
StrategoBoard()
|
Method Summary | |
---|---|
void |
deityMode(int row,
int column)
This Method sets the unit in the given square into deity mode |
void |
flagReveal()
This Method sets both flags to not be hidden. |
StrategoPiece |
getPiece(int row,
int column)
This Method returns the piece at the given location |
boolean |
isOccupied(int row,
int column)
This Method returns true if the given square is empty, else false |
boolean |
pathIsOccupied(int row1,
int column1,
int row2,
int column2)
This Method returns true if a straight path from square 1 to square 2 is empty, else it returns false. |
void |
placePiece(int row,
int column,
StrategoPiece piece)
This Method places the given piece at the given location |
void |
removePiece(int row,
int column)
This Method removes the piece from the given location |
void |
reset()
This Method empties out the entire board |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StrategoBoard()
Method Detail |
---|
public StrategoPiece getPiece(int row, int column)
row
- the row to get the piece fromcolumn
- the column to get the piece from
public void placePiece(int row, int column, StrategoPiece piece)
row
- the row to get the piece fromcolumn
- the column to get the piece frompiece
- the piece to place at the row and columnpublic void removePiece(int row, int column)
row
- the row to remove the piece fromcolumn
- the column to remove the piece frompublic boolean isOccupied(int row, int column)
row
- the row of the square to checkcolumn
- the column of the square to checkpublic boolean pathIsOccupied(int row1, int column1, int row2, int column2)
row1
- the row of the starting square.column1
- the column of the starting square.row2
- the row of the ending square.column2
- the column of the ending square.public void reset()
public void deityMode(int row, int column)
row
- the row of the unit to deifycolumn
- the column of the unit to deifypublic void flagReveal()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |