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

Package class diagram package Player
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.udk.communication.messages.GBObjectUpdate
          extended by cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.Player
All Implemented Interfaces:
IWorldChangeEvent, IWorldObjectUpdatedEvent, IWorldObject, ILocated, ILocomotive, IRotable, IViewable, ICompositeWorldObject, IPerson, IGBViewable, IGBWorldObjectEvent, IPlayer, cz.cuni.amis.utils.listener.Event

public class Player
extends GBObjectUpdate
implements IGBWorldObjectEvent, IWorldObject, IPerson, IGBViewable, IPlayer

Synchronous message. Contains information about other players in the game, like their current velocity, position, weapon and reachability. Only reports those players that are visible. (within field of view and not occluded). Corresponding GameBots message is PLR.


Nested Class Summary
static class Player.ObjectDisappeared
          Used to drop Visible flag from the object.
 
Nested classes/interfaces inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent
IWorldObjectUpdatedEvent.DestroyWorldObject
 
Field Summary
protected  String Action
          Atomic action this bot is doing (BDI).
protected  int Firing
          0 means is not firing, 1 - firing in primary mode, 2 - firing in secondary mode (alt firing).
protected  UnrealId Id
          Unique Id of the player.
protected  String Jmx
          Exported just for control server.
protected  Location Location
          An absolute location of the player within the map.
protected  String Name
          Human readable name of the player.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  boolean Reachable
          True if the bot can run to this other player directly, false otherwise.
protected  Rotation Rotation
          Which direction the player is facing in absolute terms.
protected  int Team
          What team the player is on.
protected  double Time
           
protected  Velocity Velocity
          Absolute velocity of the player as a vector of movement per one game second.
protected  boolean Visible
          If the player is in the field of view of the bot.
protected  String Weapon
          Class of the weapon the player is holding.
 
Constructor Summary
Player()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
Player(Player original)
          Cloning constructor.
Player(Player Original, boolean Visible)
          Used to create event that drops the Visible flag of the item.
Player(UnrealId Id, String Jmx, String Name, String Action, boolean Visible, Rotation Rotation, Location Location, Velocity Velocity, int Team, String Weapon, boolean Reachable, int Firing)
          Creates new instance of command Player.
 
Method Summary
 IGBWorldObjectDisappeared createDisappearEvent()
          Creates an update event that has to update visibility to false.
 boolean equals(Object obj)
           
 String getAction()
          Atomic action this bot is doing (BDI).
 int getFiring()
          0 means is not firing, 1 - firing in primary mode, 2 - firing in secondary mode (alt firing).
 UnrealId getId()
          Unique Id of the player.
 String getJmx()
          Exported just for control server.
 double getLastSeenTime()
           
 ILocalWorldObject getLocal()
           
 Location getLocation()
          An absolute location of the player within the map.
 String getName()
          Human readable name of the player.
 IWorldObject getObject()
          Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).
 Rotation getRotation()
          Which direction the player is facing in absolute terms.
 ISharedWorldObject getShared()
           
 long getSimTime()
           
 IStaticWorldObject getStatic()
           
 int getTeam()
          What team the player is on.
protected  double getTime()
           
 Velocity getVelocity()
          Absolute velocity of the player as a vector of movement per one game second.
 String getWeapon()
          Class of the weapon the player is holding.
 int hashCode()
           
 boolean isReachable()
          True if the bot can run to this other player directly, false otherwise.
 boolean isVisible()
          If the player is in the field of view of the bot.
protected  void setTime(double time)
           
 String toHtmlString()
           
 String toString()
           
 IWorldObjectUpdateResult update(IWorldObject obj)
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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

Id

protected UnrealId Id
Unique Id of the player.


Jmx

protected String Jmx
Exported just for control server. Holds jmx address we need to connect to when we want to debug our bot.


Name

protected String Name
Human readable name of the player.


Action

protected String Action
Atomic action this bot is doing (BDI).


Visible

protected boolean Visible
If the player is in the field of view of the bot.


Rotation

protected Rotation Rotation
Which direction the player is facing in absolute terms.


Location

protected Location Location
An absolute location of the player within the map.


Velocity

protected Velocity Velocity
Absolute velocity of the player as a vector of movement per one game second.


Team

protected int Team
What team the player is on. 255 is no team. 0-3 are red, blue, green, gold in that order.


Weapon

protected String Weapon
Class of the weapon the player is holding. Weapon strings to look for include: "LinkGun", "RocketLauncher", "RocketLauncher_Content". TODO: Look if this is all.


Reachable

protected boolean Reachable
True if the bot can run to this other player directly, false otherwise. Possible reasons for false: pit or obstacle between the two characters.


Firing

protected int Firing
0 means is not firing, 1 - firing in primary mode, 2 - firing in secondary mode (alt firing).


Time

protected double Time
Constructor Detail

Player

public Player(UnrealId Id,
              String Jmx,
              String Name,
              String Action,
              boolean Visible,
              Rotation Rotation,
              Location Location,
              Velocity Velocity,
              int Team,
              String Weapon,
              boolean Reachable,
              int Firing)
Creates new instance of command Player. Synchronous message. Contains information about other players in the game, like their current velocity, position, weapon and reachability. Only reports those players that are visible. (within field of view and not occluded). Corresponding GameBots message for this command is .

Parameters:
Id - Unique Id of the player.
Jmx - Exported just for control server. Holds jmx address we need to connect to when we want to debug our bot.
Name - Human readable name of the player.
Action - Atomic action this bot is doing (BDI).
Visible - If the player is in the field of view of the bot.
Rotation - Which direction the player is facing in absolute terms.
Location - An absolute location of the player within the map.
Velocity - Absolute velocity of the player as a vector of movement per one game second.
Team - What team the player is on. 255 is no team. 0-3 are red, blue, green, gold in that order.
Weapon - Class of the weapon the player is holding. Weapon strings to look for include: "LinkGun", "RocketLauncher", "RocketLauncher_Content". TODO: Look if this is all.
Reachable - True if the bot can run to this other player directly, false otherwise. Possible reasons for false: pit or obstacle between the two characters.
Firing - 0 means is not firing, 1 - firing in primary mode, 2 - firing in secondary mode (alt firing).

Player

public Player(Player original)
Cloning constructor.


Player

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


Player

public Player(Player Original,
              boolean Visible)
Used to create event that drops the Visible flag of the item.

Method Detail

getId

public UnrealId getId()
Unique Id of the player.

Specified by:
getId in interface IWorldObjectUpdatedEvent
Specified by:
getId in interface IWorldObject
Specified by:
getId in interface IPlayer

getJmx

public String getJmx()
Exported just for control server. Holds jmx address we need to connect to when we want to debug our bot.


getName

public String getName()
Human readable name of the player.

Specified by:
getName in interface IPerson
Specified by:
getName in interface IPlayer

getAction

public String getAction()
Atomic action this bot is doing (BDI).

Specified by:
getAction in interface IPlayer

isVisible

public boolean isVisible()
If the player is in the field of view of the bot.

Specified by:
isVisible in interface IViewable
Specified by:
isVisible in interface IPlayer

getRotation

public Rotation getRotation()
Which direction the player is facing in absolute terms.

Specified by:
getRotation in interface IRotable
Specified by:
getRotation in interface IPlayer

getLocation

public Location getLocation()
An absolute location of the player within the map.

Specified by:
getLocation in interface ILocated
Specified by:
getLocation in interface IPlayer

getVelocity

public Velocity getVelocity()
Absolute velocity of the player as a vector of movement per one game second.

Specified by:
getVelocity in interface ILocomotive
Specified by:
getVelocity in interface IPlayer

getTeam

public int getTeam()
What team the player is on. 255 is no team. 0-3 are red, blue, green, gold in that order.

Specified by:
getTeam in interface IPlayer

getWeapon

public String getWeapon()
Class of the weapon the player is holding. Weapon strings to look for include: "LinkGun", "RocketLauncher", "RocketLauncher_Content". TODO: Look if this is all.

Specified by:
getWeapon in interface IPlayer

isReachable

public boolean isReachable()
True if the bot can run to this other player directly, false otherwise. Possible reasons for false: pit or obstacle between the two characters.


getFiring

public int getFiring()
0 means is not firing, 1 - firing in primary mode, 2 - firing in secondary mode (alt firing).

Specified by:
getFiring in interface IPlayer

getTime

protected double getTime()

setTime

protected void setTime(double time)

getLastSeenTime

public double getLastSeenTime()

getLocal

public ILocalWorldObject getLocal()
Specified by:
getLocal in interface ICompositeWorldObject

getShared

public ISharedWorldObject getShared()
Specified by:
getShared in interface ICompositeWorldObject

getStatic

public IStaticWorldObject getStatic()
Specified by:
getStatic in interface ICompositeWorldObject

getSimTime

public long getSimTime()
Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldObject
Specified by:
getSimTime in interface IPlayer

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

createDisappearEvent

public IGBWorldObjectDisappeared createDisappearEvent()
Description copied from interface: IGBViewable
Creates an update event that has to update visibility to false.

Specified by:
createDisappearEvent in interface IGBViewable
Returns:

update

public IWorldObjectUpdateResult update(IWorldObject obj)
Specified by:
update in interface IWorldObjectUpdatedEvent

getObject

public IWorldObject getObject()
Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).


toString

public String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()
Specified by:
toHtmlString in interface IPlayer


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