cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands
Class Rotate

Package class diagram package Rotate
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.CommandMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Rotate

public class Rotate
extends CommandMessage

Representation of the GameBots2004 command ROTATE. Turns the bot by a specified amount.


Field Summary
protected  Integer Amount
          Amount in UT units to rotate.
protected  String Axis
          If provided as "Vertical", rotation will be done to Pitch (up/down).
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
 
Constructor Summary
Rotate()
          Creates new instance of command Rotate.
Rotate(Integer Amount, String Axis)
          Creates new instance of command Rotate.
Rotate(Rotate original)
          Cloning constructor.
 
Method Summary
 Integer getAmount()
          Amount in UT units to rotate.
 String getAxis()
          If provided as "Vertical", rotation will be done to Pitch (up/down).
 Rotate setAmount(Integer Amount)
          Amount in UT units to rotate.
 Rotate setAxis(String Axis)
          If provided as "Vertical", rotation will be done to Pitch (up/down).
 String toHtmlString()
           
 String toMessage()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

Amount

protected Integer Amount
Amount in UT units to rotate. May be negative to rotate counter clockwise. This rotation is relatively added to bot current rotation, then the shortest turn to achieve this new rotation will be performed (so the maximum turn you can achive is to turn back by supporting value 32767 or -32767).


Axis

protected String Axis
If provided as "Vertical", rotation will be done to Pitch (up/down). Any other value, or not provided, and rotation will be to Yaw (left/right).

Constructor Detail

Rotate

public Rotate(Integer Amount,
              String Axis)
Creates new instance of command Rotate. Turns the bot by a specified amount. Corresponding GameBots message for this command is ROTATE.

Parameters:
Amount - Amount in UT units to rotate. May be negative to rotate counter clockwise. This rotation is relatively added to bot current rotation, then the shortest turn to achieve this new rotation will be performed (so the maximum turn you can achive is to turn back by supporting value 32767 or -32767).
Axis - If provided as "Vertical", rotation will be done to Pitch (up/down). Any other value, or not provided, and rotation will be to Yaw (left/right).

Rotate

public Rotate()
Creates new instance of command Rotate. Turns the bot by a specified amount. Corresponding GameBots message for this command is ROTATE.

WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!


Rotate

public Rotate(Rotate original)
Cloning constructor.

Parameters:
original -
Method Detail

getAmount

public Integer getAmount()
Amount in UT units to rotate. May be negative to rotate counter clockwise. This rotation is relatively added to bot current rotation, then the shortest turn to achieve this new rotation will be performed (so the maximum turn you can achive is to turn back by supporting value 32767 or -32767).


setAmount

public Rotate setAmount(Integer Amount)
Amount in UT units to rotate. May be negative to rotate counter clockwise. This rotation is relatively added to bot current rotation, then the shortest turn to achieve this new rotation will be performed (so the maximum turn you can achive is to turn back by supporting value 32767 or -32767).


getAxis

public String getAxis()
If provided as "Vertical", rotation will be done to Pitch (up/down). Any other value, or not provided, and rotation will be to Yaw (left/right).


setAxis

public Rotate setAxis(String Axis)
If provided as "Vertical", rotation will be done to Pitch (up/down). Any other value, or not provided, and rotation will be to Yaw (left/right).


toString

public String toString()
Overrides:
toString in class CommandMessage

toHtmlString

public String toHtmlString()

toMessage

public String toMessage()


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.