|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbot.Bot
This is the basic Bot class. It is a primitive bot which does not do anything and needs to, in order to wander the maze.
It has the following basic methods of interest:
step()
turn()
Thing feel()
Thing grab()
say( String )
| Field Summary | |
protected BotBoard |
board
The BotBoard is the interface between the Bot and the actual Board maze. |
| Constructor Summary | |
Bot()
Build a bot. |
|
| Method Summary | |
abstract void |
compute()
This is what the system runs so the bot can run around the maze. |
void |
drop(Thing t)
ACTION: Drop a thing in the square I am standing on. |
Thing |
feel()
ACTION: Feel in direction bot is facing. |
boolean |
feelKey()
ACTION: This returns true if the bot feels a key right in front of it. |
boolean |
feelPit()
ACTION: This returns true if the bot feels a pit right in front of it. |
boolean |
feelWall()
ACTION: This returns true if the bot is facing a wall. |
Board |
getBoard()
|
BotBoard |
getBotBoard()
|
int |
getHeading()
Bots are always facing one of the cardinal directions. |
Informer |
getInformer()
Get the interface for the bot |
String |
getInput()
ACTION: Get input from the human. |
char |
getInputCharacter()
Get single character of input from human (as soon as possible, no blocking.) |
int |
getIntFromHuman()
ACTION: Get an integer from the human. |
Point |
getLocation()
Return where bot is. |
String |
getStringFromHuman()
ACTION: Get a string from the human. |
Thing |
grab()
ACTION: Grabs the thing in front of bot. |
void |
left()
ACTION: Turn left 90 degrees. |
void |
place(Thing t)
ACTION: Place a thing in the square in front of me. |
void |
rest()
ACTION: Take a small nap. |
void |
right()
ACTION: Turn right 90 degrees. |
void |
say(boolean b)
|
void |
say(double f)
|
void |
say(int v)
|
void |
say(Object t)
ACTION: Say the passed object. |
void |
say(String s)
ACTION: Say the string. |
void |
setAppearance(String toWhat)
Change what bot looks like! |
void |
step()
ACTION: Take a single step in the current direction. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected BotBoard board
| Constructor Detail |
public Bot()
| Method Detail |
public Informer getInformer()
public Board getBoard()
public BotBoard getBotBoard()
public void rest()
public void step()
throws BotException
BotExceptionpublic int getHeading()
public void right()
public void left()
public Thing feel()
public Thing grab()
throws BotException
BotException
public void place(Thing t)
throws BotException
t - The object to put down.
BotException
public void drop(Thing t)
throws BotException
t - The object to put down.
BotExceptionpublic void say(String s)
s - The string to say.public void say(Object t)
t - The thing to say.public void say(int v)
public void say(double f)
public void say(boolean b)
public Point getLocation()
public boolean feelWall()
public boolean feelKey()
public boolean feelPit()
public String getStringFromHuman()
public int getIntFromHuman()
public String getInput()
public char getInputCharacter()
public void setAppearance(String toWhat)
toWhat - is a name of an image file.public abstract void compute()
All bots need to implement this method so they can do stuff.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||