|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectKoalaRobot
Robot
public class Robot
| Constructor Summary | |
|---|---|
Robot(int x,
int y)
Constructs a robot at a given grid location. |
|
| Method Summary | |
|---|---|
void |
draw(java.awt.Graphics2D g2)
Draws this robot in 2D. |
void |
dropBeeper()
Drops a beeper at the current location of this robot. |
boolean |
frontHasWall()
Checks whether there is a wall in front of this robot. |
boolean |
isOverBeeper()
Checks whether there is a beeper under this robot. |
void |
moveForward()
Moves this robot in the direction into which it faces. |
boolean |
rightHasWall()
Checks whether there is a wall to the right of this robot. |
java.lang.String |
toString()
|
void |
turnLeft()
Turns this robot left. |
void |
turnRight()
Turns this robot right. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Robot(int x,
int y)
x - the x location of the roboty - the y location of the robot| Method Detail |
|---|
public void moveForward()
public void turnLeft()
public void turnRight()
public boolean frontHasWall()
public boolean rightHasWall()
public void dropBeeper()
public boolean isOverBeeper()
public java.lang.String toString()
public void draw(java.awt.Graphics2D g2)
g2 - the graphics context
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||