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

Package class diagram package KeyEvent
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.udk.communication.messages.GBEvent
          extended by cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.KeyEvent
All Implemented Interfaces:
IWorldChangeEvent, IWorldEventWrapper, IWorldEvent, IGBWorldEvent, cz.cuni.amis.utils.listener.Event

public class KeyEvent
extends GBEvent
implements IWorldEvent, IWorldChangeEvent

Asynchronous message. Response to key event (key press, key release...). Corresponding GameBots message is KEYEVENT.


Field Summary
protected  String Action
          Action that happened with the key.
protected  String Key
          Key that has been pressed, released or held.
protected  String Player
          Name of player who has triggered the key event.
protected  UnrealId PlayerId
          Id of player who has triggered the key event.
protected  String PlayerName
          Name of player who has triggered the key event.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
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()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
KeyEvent(KeyEvent original)
          Cloning constructor.
KeyEvent(String Player, UnrealId PlayerId, String PlayerName, UnrealId ViewTarget, String Action, String Key)
          Creates new instance of command KeyEvent.
 
Method Summary
 String getAction()
          Action that happened with the key.
 String getKey()
          Key that has been pressed, released or held.
 String getPlayer()
          Name of player who has triggered the key event.
 UnrealId getPlayerId()
          Id of player who has triggered the key event.
 String getPlayerName()
          Name of player who has triggered the key event.
 long getSimTime()
           
 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.
 String toHtmlString()
           
 String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.udk.communication.messages.GBEvent
getWorldEvent
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
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 player who has triggered the key event.


PlayerId

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


PlayerName

protected 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 String Action
Action that happened with the key. Possible are: PRESS, HOLD, RELEASE.


Key

protected 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(String Player,
                UnrealId PlayerId,
                String PlayerName,
                UnrealId ViewTarget,
                String Action,
                String Key)
Creates new instance of command KeyEvent. Asynchronous message. Response to key event (key press, key release...). Corresponding GameBots message for this command is .

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.


KeyEvent

public KeyEvent()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).

Method Detail

getPlayer

public 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 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 String getAction()
Action that happened with the key. Possible are: PRESS, HOLD, RELEASE.


getKey

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


getSimTime

public long getSimTime()
Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldEvent
Overrides:
getSimTime in class GBEvent

toString

public String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()


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