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

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

public class CommandPlayer
extends CommandMessage

Representation of the GameBots2004 command COMPLR. Commands player's character to perform some action.


Field Summary
protected  String Command
          Available: MOVE, TURNTO.
protected  Location FocusLocation
          Applicable for: MOVE.
protected  Location Location
          Applicable for: MOVE, TURNTO.
protected  String Player
          Name of the affected player.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  Rotation Rotation
          Applicable for: TURNTO.
protected  Boolean Walk
          Applicable for: MOVE.
 
Constructor Summary
CommandPlayer()
          Creates new instance of command CommandPlayer.
CommandPlayer(CommandPlayer original)
          Cloning constructor.
CommandPlayer(String Player, String Command, Location Location, Location FocusLocation, Boolean Walk, Rotation Rotation)
          Creates new instance of command CommandPlayer.
 
Method Summary
 String getCommand()
          Available: MOVE, TURNTO.
 Location getFocusLocation()
          Applicable for: MOVE.
 Location getLocation()
          Applicable for: MOVE, TURNTO.
 String getPlayer()
          Name of the affected player.
 Rotation getRotation()
          Applicable for: TURNTO.
 Boolean isWalk()
          Applicable for: MOVE.
 CommandPlayer setCommand(String Command)
          Available: MOVE, TURNTO.
 CommandPlayer setFocusLocation(Location FocusLocation)
          Applicable for: MOVE.
 CommandPlayer setLocation(Location Location)
          Applicable for: MOVE, TURNTO.
 CommandPlayer setPlayer(String Player)
          Name of the affected player.
 CommandPlayer setRotation(Rotation Rotation)
          Applicable for: TURNTO.
 CommandPlayer setWalk(Boolean Walk)
          Applicable for: MOVE.
 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

Player

protected String Player
Name of the affected player.


Command

protected String Command
Available: MOVE, TURNTO.


Location

protected Location Location
Applicable for: MOVE, TURNTO.


FocusLocation

protected Location FocusLocation
Applicable for: MOVE.


Walk

protected Boolean Walk
Applicable for: MOVE. If the character should walk instead of run.


Rotation

protected Rotation Rotation
Applicable for: TURNTO.

Constructor Detail

CommandPlayer

public CommandPlayer(String Player,
                     String Command,
                     Location Location,
                     Location FocusLocation,
                     Boolean Walk,
                     Rotation Rotation)
Creates new instance of command CommandPlayer. Commands player's character to perform some action. Corresponding GameBots message for this command is COMPLR.

Parameters:
Player - Name of the affected player.
Command - Available: MOVE, TURNTO.
Location - Applicable for: MOVE, TURNTO.
FocusLocation - Applicable for: MOVE.
Walk - Applicable for: MOVE. If the character should walk instead of run.
Rotation - Applicable for: TURNTO.

CommandPlayer

public CommandPlayer()
Creates new instance of command CommandPlayer. Commands player's character to perform some action. Corresponding GameBots message for this command is COMPLR.

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


CommandPlayer

public CommandPlayer(CommandPlayer original)
Cloning constructor.

Parameters:
original -
Method Detail

getPlayer

public String getPlayer()
Name of the affected player.


setPlayer

public CommandPlayer setPlayer(String Player)
Name of the affected player.


getCommand

public String getCommand()
Available: MOVE, TURNTO.


setCommand

public CommandPlayer setCommand(String Command)
Available: MOVE, TURNTO.


getLocation

public Location getLocation()
Applicable for: MOVE, TURNTO.


setLocation

public CommandPlayer setLocation(Location Location)
Applicable for: MOVE, TURNTO.


getFocusLocation

public Location getFocusLocation()
Applicable for: MOVE.


setFocusLocation

public CommandPlayer setFocusLocation(Location FocusLocation)
Applicable for: MOVE.


isWalk

public Boolean isWalk()
Applicable for: MOVE. If the character should walk instead of run.


setWalk

public CommandPlayer setWalk(Boolean Walk)
Applicable for: MOVE. If the character should walk instead of run.


getRotation

public Rotation getRotation()
Applicable for: TURNTO.


setRotation

public CommandPlayer setRotation(Rotation Rotation)
Applicable for: TURNTO.


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.