de.uni_paderborn.robots.actions
Class RotateAction

java.lang.Object
  |
  +--de.uni_paderborn.robots.actions.AbstractAction
        |
        +--de.uni_paderborn.robots.actions.RotateAction

public class RotateAction
extends AbstractAction

the class for rotating a robot


Field Summary
private  int direction
          the direction the robot looks:
Robot.NORTH Robot.WEST Robot.SOUTH Robot.EAST
 
Constructor Summary
RotateAction(int direction)
          to change the direction of the robot
 
Method Summary
 void doAction(Robot robot)
          changes the direction of the robot and updates the gui.
 int getDirection()
          Read access method for attribute direction
 int setDirection(int direction)
          Write access method for attribute direction
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

direction

private int direction
the direction the robot looks:
Constructor Detail

RotateAction

public RotateAction(int direction)
to change the direction of the robot
Parameters:
direction - as an int
Method Detail

doAction

public void doAction(Robot robot)
changes the direction of the robot and updates the gui.
Overrides:
doAction in class AbstractAction
Parameters:
robot - the Robot for which doAction should be executed

getDirection

public int getDirection()
Read access method for attribute direction
Returns:
direction of the robot

setDirection

public int setDirection(int direction)
Write access method for attribute direction
Parameters:
direction - the new direction of the robot