|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbot.Board
This holds the maze the bot wanders around in. It is a collection of Squares.
| Constructor Summary | |
Board()
Make an empty board. |
|
| Method Summary | |
Square |
addSquare(int x,
int y)
Add point if not already added. |
Square |
addSquare(Point p)
Add point if not already added. |
void |
addSquare(Square s)
Adds a square unless that location already exists, in which case it does nothing. |
Object |
clone()
|
void |
endAction(Bot b)
If the board wants to hear about an action being ended, override this and make a special board. |
Point |
getCenter()
Get coordinates of the center of the board. |
Dimension |
getDimensions()
|
int |
getHeight()
|
Square |
getSquare(int x,
int y)
Get square at given location. |
Square |
getSquare(Point p)
Get square at given location. |
Set |
getSquares()
Get all the squares on the board. |
Point |
getTLCorner()
Get topleft coordinate of board. |
int |
getWidth()
|
WinChecker |
getWinChecker()
If you want special win conditions for the board, override this. |
boolean |
hasSquare(int x,
int y)
Is there a square at this location? |
boolean |
hasSquare(Point p)
Is there a square at this location? |
boolean |
hasSquare(Square sq)
Is this square (or a square with the same coordinates) on the board? |
boolean |
isKeyBoard()
Does this board revolve around picking up keys? |
static Board |
loadBoard(File f)
Load a board from a given file. |
static Board |
loadBoard(InputStream is)
|
int |
numSquares()
How many squares are in this board? |
void |
save(File f)
Save this board to a file. |
void |
save(String fname)
|
void |
setInformer(Informer inf)
If we need to know who our informer is. |
void |
setStart(int x,
int y)
|
void |
setStart(Square new_start)
Set which square is the bot's starting square. |
Square |
start()
Get the start square of the bot. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Board()
| Method Detail |
public Object clone()
public static Board loadBoard(File f)
throws IOException
IOException
public static Board loadBoard(InputStream is)
throws IOException
IOException
public void save(String fname)
throws IOException
IOException
public void save(File f)
throws IOException
IOException
public Square addSquare(int x,
int y)
public Square addSquare(Point p)
public void addSquare(Square s)
public Point getTLCorner()
public Point getCenter()
public int getHeight()
public int getWidth()
public Dimension getDimensions()
public void setStart(Square new_start)
public void setStart(int x,
int y)
public Square start()
public boolean hasSquare(Point p)
public boolean hasSquare(int x,
int y)
public boolean hasSquare(Square sq)
public Square getSquare(Point p)
public Square getSquare(int x,
int y)
public Set getSquares()
public WinChecker getWinChecker()
public void endAction(Bot b)
public int numSquares()
public void setInformer(Informer inf)
public boolean isKeyBoard()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||