de.uni_paderborn.robots.robotArenaInterface
Class RotateAction

java.lang.Object
  |
  +--de.uni_paderborn.robots.robotArenaInterface.AbstractRobotAction
        |
        +--de.uni_paderborn.robots.robotArenaInterface.RotateAction

public final class RotateAction
extends AbstractRobotAction

This class describes a RotateAction.
RotateAction is a possible return value
of the "getCommand" method.
This Action should be returned
by "getCommand" if a robot wants to
rotate.
The energy of the robot will decrease.


Field Summary
private  byte direction
          
"direction"'s value is between 0 and 5
1 = rotate 60° clockwise
2 = rotate 120° clockwise
3 = rotate 180° clockwise
4 = rotate 240° clockwise
5 = rotate 300° clockwise

 
Constructor Summary
RotateAction(int direction)
          
the parameter "direction" of RotateAction allows the complete range of "int"
( WARNING : 0 and multiples of 6 cause the arena to decrease the energy of the robot without changing the direction )

sane examples :
-8 = rotate 120° counter clockwise ( to the left )
-5 = rotate 300° counter clockwise ( to the left )
-3 = rotate 180° counter clockwise ( to the left )
-2 = rotate 120° counter clockwise ( to the left )
-1 = rotate 60° counter clockwise ( to the left )
1 = rotate 60° clockwise ( to the right )
3 = rotate 180° clockwise ( to the right )
4 = rotate 240° clockwise ( to the right )
7 = rotate 60° clockwise ( to the right )

 
Method Summary
 byte getDirection()
          
returns a number between 0 and 5

0 = robot wants to drain energy
1 = robot wants to rotate 60° clockwise ( 1xright )
2 = robot wants to rotate 120° clockwise ( 2xright )
3 = robot wants to rotate 180° clockwise ( u-turn )
4 = robot wants to rotate 240° clockwise ( 2xleft )
5 = robot wants to rotate 300° clockwise ( 1xleft )

 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

direction

private byte direction

"direction"'s value is between 0 and 5
1 = rotate 60° clockwise
2 = rotate 120° clockwise
3 = rotate 180° clockwise
4 = rotate 240° clockwise
5 = rotate 300° clockwise

Constructor Detail

RotateAction

public RotateAction(int direction)

the parameter "direction" of RotateAction allows the complete range of "int"
( WARNING : 0 and multiples of 6 cause the arena to decrease the energy of the robot without changing the direction )

sane examples :
-8 = rotate 120° counter clockwise ( to the left )
-5 = rotate 300° counter clockwise ( to the left )
-3 = rotate 180° counter clockwise ( to the left )
-2 = rotate 120° counter clockwise ( to the left )
-1 = rotate 60° counter clockwise ( to the left )
1 = rotate 60° clockwise ( to the right )
3 = rotate 180° clockwise ( to the right )
4 = rotate 240° clockwise ( to the right )
7 = rotate 60° clockwise ( to the right )

Parameters:
direction - Direction in which the robot wants to be rotated to
Method Detail

getDirection

public byte getDirection()

returns a number between 0 and 5

0 = robot wants to drain energy
1 = robot wants to rotate 60° clockwise ( 1xright )
2 = robot wants to rotate 120° clockwise ( 2xright )
3 = robot wants to rotate 180° clockwise ( u-turn )
4 = robot wants to rotate 240° clockwise ( 2xleft )
5 = robot wants to rotate 300° clockwise ( 1xleft )

Returns:
Direction robot wants to be rotated to