cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages
Class KeyEvent

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.KeyEvent
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, Event

public class KeyEvent
extends InfoMessage
implements IWorldEvent, IWorldChangeEvent

Definition of the event KEYEVENT.

Complete message documentation: Asynchronous message. Response to key event (key press, key release...) when previous SETSENDKEYS command turned this sending on.


Field Summary
protected  java.lang.String Action
          Action that happened with the key.
protected  java.lang.String Key
          Key that has been pressed, released or held.
protected  java.lang.String Player
          Name of player who has triggered the key event.
protected  UnrealId PlayerId
          Id of player who has triggered the key event.
protected  java.lang.String PlayerName
          Name of player who has triggered the key event.
static java.lang.String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  long SimTime
           
protected  UnrealId ViewTarget
          If the player that triggered the key event is observing another player in the game, then the id of that observed player will be exported here.
 
Constructor Summary
KeyEvent()
          Parameter-less contructor for the message.
KeyEvent(KeyEvent original)
          Cloning constructor from the full message.
KeyEvent(java.lang.String Player, UnrealId PlayerId, java.lang.String PlayerName, UnrealId ViewTarget, java.lang.String Action, java.lang.String Key)
          Creates new instance of the message KeyEvent.
 
Method Summary
 java.lang.String getAction()
          Action that happened with the key.
 java.lang.String getKey()
          Key that has been pressed, released or held.
 java.lang.String getPlayer()
          Name of player who has triggered the key event.
 UnrealId getPlayerId()
          Id of player who has triggered the key event.
 java.lang.String getPlayerName()
          Name of player who has triggered the key event.
 long getSimTime()
          Returns the simulation time when the event has occurred.
 UnrealId getViewTarget()
          If the player that triggered the key event is observing another player in the game, then the id of that observed player will be exported here.
protected  void setSimTime(long SimTime)
          Used by Yylex to slip correct time of the object or programmatically.
 java.lang.String toHtmlString()
           
 java.lang.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 java.lang.String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

SimTime

protected long SimTime

Player

protected java.lang.String Player
Name of player who has triggered the key event.


PlayerId

protected UnrealId PlayerId
Id of player who has triggered the key event.


PlayerName

protected java.lang.String PlayerName
Name of player who has triggered the key event.


ViewTarget

protected UnrealId ViewTarget
If the player that triggered the key event is observing another player in the game, then the id of that observed player will be exported here.


Action

protected java.lang.String Action
Action that happened with the key. Possible are: PRESS, HOLD, RELEASE.


Key

protected java.lang.String Key
Key that has been pressed, released or held. See Interactions.EInputKey for choices - these are without the "IK_" prefix with original case.

Constructor Detail

KeyEvent

public KeyEvent()
Parameter-less contructor for the message.


KeyEvent

public KeyEvent(java.lang.String Player,
                UnrealId PlayerId,
                java.lang.String PlayerName,
                UnrealId ViewTarget,
                java.lang.String Action,
                java.lang.String Key)
Creates new instance of the message KeyEvent. Asynchronous message. Response to key event (key press, key release...) when previous SETSENDKEYS command turned this sending on. Corresponding GameBots message is KEYEVENT.

Parameters:
Player - Name of player who has triggered the key event.
PlayerId - Id of player who has triggered the key event.
PlayerName - Name of player who has triggered the key event.
ViewTarget - If the player that triggered the key event is observing another player in the game, then the id of that observed player will be exported here.
Action - Action that happened with the key. Possible are: PRESS, HOLD, RELEASE.
Key - Key that has been pressed, released or held. See Interactions.EInputKey for choices - these are without the "IK_" prefix with original case.

KeyEvent

public KeyEvent(KeyEvent original)
Cloning constructor from the full message.

Parameters:
original -
Method Detail

getSimTime

public long getSimTime()
Description copied from interface: IWorldEvent
Returns the simulation time when the event has occurred.

Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldEvent
Returns:
timestamp

setSimTime

protected void setSimTime(long SimTime)
Used by Yylex to slip correct time of the object or programmatically.


getPlayer

public java.lang.String getPlayer()
Name of player who has triggered the key event.


getPlayerId

public UnrealId getPlayerId()
Id of player who has triggered the key event.


getPlayerName

public java.lang.String getPlayerName()
Name of player who has triggered the key event.


getViewTarget

public UnrealId getViewTarget()
If the player that triggered the key event is observing another player in the game, then the id of that observed player will be exported here.


getAction

public java.lang.String getAction()
Action that happened with the key. Possible are: PRESS, HOLD, RELEASE.


getKey

public java.lang.String getKey()
Key that has been pressed, released or held. See Interactions.EInputKey for choices - these are without the "IK_" prefix with original case.


toString

public java.lang.String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public java.lang.String toHtmlString()