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

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

public class Dodge
extends CommandMessage

Representation of the GameBots2004 command DODGE. Causes the bot to dodge to supported direction. Only one (successful) dodge per second allowed.


Field Summary
protected  Location Direction
          Relative vector, will be normalized.
protected  Boolean Double
          If true performs a double dodge in specified direction.
protected  Location FocusPoint
          Point the bot should focus after dodge command.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  Boolean Wall
          Attemtps to do a wall dodge.
 
Constructor Summary
Dodge()
          Creates new instance of command Dodge.
Dodge(Dodge original)
          Cloning constructor.
Dodge(Location Direction, Location FocusPoint, Boolean Wall, Boolean Double)
          Creates new instance of command Dodge.
 
Method Summary
 Location getDirection()
          Relative vector, will be normalized.
 Location getFocusPoint()
          Point the bot should focus after dodge command.
 Boolean isDouble()
          If true performs a double dodge in specified direction.
 Boolean isWall()
          Attemtps to do a wall dodge.
 Dodge setDirection(Location Direction)
          Relative vector, will be normalized.
 Dodge setDouble(Boolean Double)
          If true performs a double dodge in specified direction.
 Dodge setFocusPoint(Location FocusPoint)
          Point the bot should focus after dodge command.
 Dodge setWall(Boolean Wall)
          Attemtps to do a wall dodge.
 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

Direction

protected Location Direction
Relative vector, will be normalized. The direction of the dodge will be added to current bot rotation.


FocusPoint

protected Location FocusPoint
Point the bot should focus after dodge command. Note that if not specified, this will be set automatically by dodge command to 1200 ut units in front of the bot at the time when the dodge command is issued.


Wall

protected Boolean Wall
Attemtps to do a wall dodge. There has to be a wall in the opposite direction of the dodge. If there isn't, nothing will happen! This switch overrides "Double" dodge switch.


Double

protected Boolean Double
If true performs a double dodge in specified direction.

Constructor Detail

Dodge

public Dodge(Location Direction,
             Location FocusPoint,
             Boolean Wall,
             Boolean Double)
Creates new instance of command Dodge. Causes the bot to dodge to supported direction. Only one (successful) dodge per second allowed. Corresponding GameBots message for this command is DODGE.

Parameters:
Direction - Relative vector, will be normalized. The direction of the dodge will be added to current bot rotation.
FocusPoint - Point the bot should focus after dodge command. Note that if not specified, this will be set automatically by dodge command to 1200 ut units in front of the bot at the time when the dodge command is issued.
Wall - Attemtps to do a wall dodge. There has to be a wall in the opposite direction of the dodge. If there isn't, nothing will happen! This switch overrides "Double" dodge switch.
Double - If true performs a double dodge in specified direction.

Dodge

public Dodge()
Creates new instance of command Dodge. Causes the bot to dodge to supported direction. Only one (successful) dodge per second allowed. Corresponding GameBots message for this command is DODGE.

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


Dodge

public Dodge(Dodge original)
Cloning constructor.

Parameters:
original -
Method Detail

getDirection

public Location getDirection()
Relative vector, will be normalized. The direction of the dodge will be added to current bot rotation.


setDirection

public Dodge setDirection(Location Direction)
Relative vector, will be normalized. The direction of the dodge will be added to current bot rotation.


getFocusPoint

public Location getFocusPoint()
Point the bot should focus after dodge command. Note that if not specified, this will be set automatically by dodge command to 1200 ut units in front of the bot at the time when the dodge command is issued.


setFocusPoint

public Dodge setFocusPoint(Location FocusPoint)
Point the bot should focus after dodge command. Note that if not specified, this will be set automatically by dodge command to 1200 ut units in front of the bot at the time when the dodge command is issued.


isWall

public Boolean isWall()
Attemtps to do a wall dodge. There has to be a wall in the opposite direction of the dodge. If there isn't, nothing will happen! This switch overrides "Double" dodge switch.


setWall

public Dodge setWall(Boolean Wall)
Attemtps to do a wall dodge. There has to be a wall in the opposite direction of the dodge. If there isn't, nothing will happen! This switch overrides "Double" dodge switch.


isDouble

public Boolean isDouble()
If true performs a double dodge in specified direction.


setDouble

public Dodge setDouble(Boolean Double)
If true performs a double dodge in specified direction.


toString

public String toString()
Overrides:
toString in class CommandMessage

toHtmlString

public String toHtmlString()

toMessage

public String toMessage()


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