|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--ants.move.bot.Bot
Implementation of MOVE! Bot.
| Constructor Summary | |
Bot(java.lang.String name,
java.lang.String avatar)
Bot's constructor. |
|
| Method Summary | |
void |
ai()
Bot's artificial intelligence (all the movements of bot) |
java.lang.String |
getName()
Returns the bot's name. |
float |
getOrientation()
Returns the current orientation of bot. |
ants.core.Place |
getPlace()
Returns the current place where bot's joined. |
float[] |
getPosition()
Returns the current position of bot. |
void |
go(float[] position)
teleports bot to a new position |
void |
joinToPlace(java.lang.String host,
java.lang.String worldKey,
java.lang.String placeKey)
Joins bot to place. |
void |
leavePlace()
Bot leaves the current place |
void |
move(float meters)
Move bot from his current position to another position, in the direction of his orientation |
void |
run()
|
void |
setOrientation(float ori)
Sets a new orientation for the bot. |
void |
setPosition(float[] pos)
Sets a new position for the bot. |
void |
talk(java.lang.String msg)
Bot sends a message to all users in this place |
void |
turnLeft()
Bot turns to left |
void |
turnRight()
Bot turns to right |
void |
wait(int millis)
Bot sleeps a number of milliseconds |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Bot(java.lang.String name,
java.lang.String avatar)
name - Bot's nameavatar - Bot's avatar representation| Method Detail |
public void setPosition(float[] pos)
pos - positionpublic void setOrientation(float ori)
ori - orientationpublic ants.core.Place getPlace()
public java.lang.String getName()
public float[] getPosition()
public float getOrientation()
public void joinToPlace(java.lang.String host,
java.lang.String worldKey,
java.lang.String placeKey)
throws java.lang.Exception
host - MOVE! hostworldKey - world's keyplaceKey - place's keypublic void move(float meters)
meters - number of meters to movepublic void go(float[] position)
position - new position of botpublic void turnLeft()
public void turnRight()
public void wait(int millis)
millis - millisecondspublic void talk(java.lang.String msg)
msg - messagepublic void leavePlace()
public final void run()
run in interface java.lang.Runnablepublic void ai()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||