|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.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 IWorldObjectUpdatedEvent
getId
in interface IWorldObject
getId
in interface IPlayer
public String getJmx()
public String getName()
getName
in interface IPerson
getName
in interface IPlayer
public String getAction()
getAction
in interface IPlayer
public boolean isVisible()
isVisible
in interface IViewable
isVisible
in interface IPlayer
public Rotation getRotation()
getRotation
in interface IRotable
getRotation
in interface IPlayer
public Location getLocation()
getLocation
in interface ILocated
getLocation
in interface IPlayer
public Velocity getVelocity()
getVelocity
in interface ILocomotive
getVelocity
in interface IPlayer
public int getTeam()
getTeam
in interface IPlayer
public String getWeapon()
getWeapon
in interface IPlayer
public boolean isReachable()
public int getFiring()
getFiring
in interface IPlayer
protected double getTime()
protected void setTime(double time)
public double getLastSeenTime()
public ILocalWorldObject getLocal()
getLocal
in interface ICompositeWorldObject
public ISharedWorldObject getShared()
getShared
in interface ICompositeWorldObject
public IStaticWorldObject getStatic()
getStatic
in interface ICompositeWorldObject
public long getSimTime()
getSimTime
in interface IWorldChangeEvent
getSimTime
in interface IWorldObject
getSimTime
in interface IPlayer
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public IGBWorldObjectDisappeared createDisappearEvent()
IGBViewable
createDisappearEvent
in interface IGBViewable
public IWorldObjectUpdateResult update(IWorldObject obj)
update
in interface IWorldObjectUpdatedEvent
public IWorldObject getObject()
public String toString()
toString
in class InfoMessage
public String toHtmlString()
toHtmlString
in interface IPlayer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |