|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPrintGame.Robot
class representing a Robot.
Constructor Summary | |
Robot()
standard constructor |
Method Summary | |
Direction |
getCurrentDirection()
|
int |
getPosCol()
|
int |
getPosRow()
|
Direction |
getStartDirection()
|
int |
getState()
method returns the mark new_area_ |
void |
goBack()
method to move a robot one cell back (relative to his current direction) |
void |
goLeft()
method to move a robot one cell left (relative to his current direction) |
void |
goRight()
method to move a robot one cell right (relative to his current direction) |
void |
moveForward()
method to move a robot one cell forward (relative to his current direction) |
protected void |
moveInDirection(Direction direction)
internal method to move a robot one cell to the given direction. |
void |
setPos(int row,
int col)
|
void |
setStartDirection(Direction start_direction)
|
void |
setState(int state)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Robot()
Method Detail |
public int getState()
public int getPosRow()
public int getPosCol()
public Direction getStartDirection()
public Direction getCurrentDirection()
public void setState(int state) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setPos(int row, int col)
public void setStartDirection(Direction start_direction) throws IllegalDirectionException
IllegalDirectionException
protected void moveInDirection(Direction direction) throws IllegalDirectionException
direction
-
IllegalDirectionException
- thrown if the direction isn't valid.public void moveForward() throws IllegalDirectionException
IllegalDirectionException
- thrown if the direction isn't valid.public void goBack() throws IllegalDirectionException
IllegalDirectionException
- thrown if the direction isn't valid.public void goLeft() throws IllegalDirectionException
IllegalDirectionException
- thrown if the direction isn't valid.public void goRight() throws IllegalDirectionException
IllegalDirectionException
- thrown if the direction isn't valid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |