|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.base.communication.messages.InfoMessage
cz.cuni.amis.pogamut.udk.communication.messages.GBObjectUpdate
cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.Player
public class 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 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 |
|---|
public static final String PROTOTYPE
protected UnrealId Id
protected String Jmx
protected String Name
protected String Action
protected boolean Visible
protected Rotation Rotation
protected Location Location
protected Velocity Velocity
protected int Team
protected String Weapon
protected boolean Reachable
protected int Firing
protected double Time
| Constructor Detail |
|---|
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)
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).public Player(Player original)
public Player()
public Player(Player Original,
boolean Visible)
| Method Detail |
|---|
public UnrealId getId()
getId in interface IWorldObjectUpdatedEventgetId in interface IWorldObjectgetId in interface IPlayerpublic String getJmx()
public String getName()
getName in interface IPersongetName in interface IPlayerpublic String getAction()
getAction in interface IPlayerpublic boolean isVisible()
isVisible in interface IViewableisVisible in interface IPlayerpublic Rotation getRotation()
getRotation in interface IRotablegetRotation in interface IPlayerpublic Location getLocation()
getLocation in interface ILocatedgetLocation in interface IPlayerpublic Velocity getVelocity()
getVelocity in interface ILocomotivegetVelocity in interface IPlayerpublic int getTeam()
getTeam in interface IPlayerpublic String getWeapon()
getWeapon in interface IPlayerpublic boolean isReachable()
public int getFiring()
getFiring in interface IPlayerprotected double getTime()
protected void setTime(double time)
public double getLastSeenTime()
public ILocalWorldObject getLocal()
getLocal in interface ICompositeWorldObjectpublic ISharedWorldObject getShared()
getShared in interface ICompositeWorldObjectpublic IStaticWorldObject getStatic()
getStatic in interface ICompositeWorldObjectpublic long getSimTime()
getSimTime in interface IWorldChangeEventgetSimTime in interface IWorldObjectgetSimTime in interface IPlayerpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic IGBWorldObjectDisappeared createDisappearEvent()
IGBViewable
createDisappearEvent in interface IGBViewablepublic IWorldObjectUpdateResult update(IWorldObject obj)
update in interface IWorldObjectUpdatedEventpublic IWorldObject getObject()
public String toString()
toString in class InfoMessagepublic String toHtmlString()
toHtmlString in interface IPlayer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||