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

Package class diagram package Self
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.Self
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent, cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent, cz.cuni.amis.pogamut.base.communication.worldview.object.IWorldObject, cz.cuni.amis.pogamut.base3d.worldview.object.ILocated, cz.cuni.amis.pogamut.base3d.worldview.object.ILocomotive, cz.cuni.amis.pogamut.base3d.worldview.object.IRotable, IPerson, IGBWorldObjectEvent, cz.cuni.amis.utils.listener.Event

public class Self
extends GBObjectUpdate
implements IGBWorldObjectEvent, cz.cuni.amis.pogamut.base.communication.worldview.object.IWorldObject, IPerson

Synchronous message. Information about your bot's state. Corresponding GameBots message is SLF.


Nested Class Summary
 
Nested classes/interfaces inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent
cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent.DestroyWorldObject
 
Field Summary
protected  String Action
          Name of the current BDI action.
protected  boolean AltFiring
          If we are firing in secondary firing mode.
protected  int Armor
          Combined size of high armor and low armor (or small armor).
protected  boolean Crouched
          If we are currently crouched.
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Location FloorLocation
          Holds current floor location under the bot.
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Location FloorNormal
          Holds current floor normal under the bot.
protected  int Health
          How much health the bot has left.
protected  cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Id
          Unique Id of the bot.
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Location Location
          An absolute location of the bot.
protected  String Name
          Human readable bot name.
protected  int PrimaryAmmo
          How much ammo the bot has left for current weapon primary mode.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Rotation Rotation
          Which direction the bot is facing in absolute terms.
protected  int SecondaryAmmo
          How much ammo the bot has left for current weapon secondary mode.
protected  boolean Shooting
          If the bot is shooting or not.
protected  int SmallArmor
          Also refered to as a "low armor".
protected  int Team
          What team the bot is on. 255 is no team. 0-3 are red, blue, green, gold in that order.
protected  double Time
           
protected  double UDamageTime
          Time when the UDamage effect expires.
protected  boolean Vehicle
          If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health" "Armor", "FloorLocation", "FloorNormal".
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Velocity Velocity
          Absolute velocity of the bot as a vector of movement per one game second.
protected  boolean Walking
          If we are currently in walking mode.
protected  cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Weapon
          Id of the weapon we are holding.
 
Constructor Summary
Self()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
Self(Self original)
          Cloning constructor.
Self(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Id, String Name, boolean Vehicle, cz.cuni.amis.pogamut.base3d.worldview.object.Location Location, cz.cuni.amis.pogamut.base3d.worldview.object.Velocity Velocity, cz.cuni.amis.pogamut.base3d.worldview.object.Rotation Rotation, int Team, cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Weapon, boolean Shooting, int Health, int PrimaryAmmo, int SecondaryAmmo, int Armor, int SmallArmor, boolean AltFiring, boolean Crouched, boolean Walking, cz.cuni.amis.pogamut.base3d.worldview.object.Location FloorLocation, cz.cuni.amis.pogamut.base3d.worldview.object.Location FloorNormal, double UDamageTime, String Action)
          Creates new instance of command Self.
 
Method Summary
 boolean equals(Object obj)
           
 String getAction()
          Name of the current BDI action.
 int getArmor()
          Combined size of high armor and low armor (or small armor).
 cz.cuni.amis.pogamut.base3d.worldview.object.Location getFloorLocation()
          Holds current floor location under the bot.
 cz.cuni.amis.pogamut.base3d.worldview.object.Location getFloorNormal()
          Holds current floor normal under the bot.
 int getHealth()
          How much health the bot has left.
 cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getId()
          Unique Id of the bot.
 double getLastSeenTime()
           
 cz.cuni.amis.pogamut.multi.communication.worldview.object.ILocalWorldObject getLocal()
           
 cz.cuni.amis.pogamut.base3d.worldview.object.Location getLocation()
          An absolute location of the bot.
 String getName()
          Human readable bot name.
 cz.cuni.amis.pogamut.base.communication.worldview.object.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).
 int getPrimaryAmmo()
          How much ammo the bot has left for current weapon primary mode.
 cz.cuni.amis.pogamut.base3d.worldview.object.Rotation getRotation()
          Which direction the bot is facing in absolute terms.
 int getSecondaryAmmo()
          How much ammo the bot has left for current weapon secondary mode.
 cz.cuni.amis.pogamut.multi.communication.worldview.object.ISharedWorldObject getShared()
           
 long getSimTime()
           
 int getSmallArmor()
          Also refered to as a "low armor".
 cz.cuni.amis.pogamut.multi.communication.worldview.object.IStaticWorldObject getStatic()
           
 int getTeam()
          What team the bot is on. 255 is no team. 0-3 are red, blue, green, gold in that order.
protected  double getTime()
           
 double getUDamageTime()
          Time when the UDamage effect expires.
 cz.cuni.amis.pogamut.base3d.worldview.object.Velocity getVelocity()
          Absolute velocity of the bot as a vector of movement per one game second.
 cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getWeapon()
          Id of the weapon we are holding.
 int hashCode()
           
 boolean isAltFiring()
          If we are firing in secondary firing mode.
 boolean isCrouched()
          If we are currently crouched.
 boolean isShooting()
          If the bot is shooting or not.
 boolean isVehicle()
          If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health" "Armor", "FloorLocation", "FloorNormal".
 boolean isWalking()
          If we are currently in walking mode.
protected  void setTime(double time)
           
 String toHtmlString()
           
 String toString()
           
 cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult update(cz.cuni.amis.pogamut.base.communication.worldview.object.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 cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Id
Unique Id of the bot.


Name

protected String Name
Human readable bot name.


Vehicle

protected boolean Vehicle
If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health" "Armor", "FloorLocation", "FloorNormal".


Location

protected cz.cuni.amis.pogamut.base3d.worldview.object.Location Location
An absolute location of the bot.


Velocity

protected cz.cuni.amis.pogamut.base3d.worldview.object.Velocity Velocity
Absolute velocity of the bot as a vector of movement per one game second.


Rotation

protected cz.cuni.amis.pogamut.base3d.worldview.object.Rotation Rotation
Which direction the bot is facing in absolute terms.


Team

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


Weapon

protected cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Weapon
Id of the weapon we are holding. This is unique Id of an item in our inventory and is different from the Id of the item we pick up from the ground! We can parse this string to look which weapon we hold. Weapon strings to look for include: "AssaultRifle", "ShieldGun", "FlakCannon", "BioRifle", "ShockRifle", "LinkGun", "SniperRifle", "RocketLauncher", "Minigun", "LightingGun", "Translocator". TODO: Look if this is all.


Shooting

protected boolean Shooting
If the bot is shooting or not.


Health

protected int Health
How much health the bot has left. Starts at 100, ranges from 0 to 200.


PrimaryAmmo

protected int PrimaryAmmo
How much ammo the bot has left for current weapon primary mode.


SecondaryAmmo

protected int SecondaryAmmo
How much ammo the bot has left for current weapon secondary mode. Weapon does not have to support sec. fire mode.


Armor

protected int Armor
Combined size of high armor and low armor (or small armor). The high and low armor are tracked separately. Low armor is limited to 50 points, while the high armor can have up to 150 points. Both stacks can have a combined size of 150 points as well, so if low armor is already at 50 points, high armor can have 100 points at max.


SmallArmor

protected int SmallArmor
Also refered to as a "low armor". Ranges from 0 to 50 points.


AltFiring

protected boolean AltFiring
If we are firing in secondary firing mode.


Crouched

protected boolean Crouched
If we are currently crouched.


Walking

protected boolean Walking
If we are currently in walking mode.


FloorLocation

protected cz.cuni.amis.pogamut.base3d.worldview.object.Location FloorLocation
Holds current floor location under the bot.


FloorNormal

protected cz.cuni.amis.pogamut.base3d.worldview.object.Location FloorNormal
Holds current floor normal under the bot.


UDamageTime

protected double UDamageTime
Time when the UDamage effect expires. If the number is higher then the current time, it means the bot has UDamage effect active right now.


Action

protected String Action
Name of the current BDI action.


Time

protected double Time
Constructor Detail

Self

public Self(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Id,
            String Name,
            boolean Vehicle,
            cz.cuni.amis.pogamut.base3d.worldview.object.Location Location,
            cz.cuni.amis.pogamut.base3d.worldview.object.Velocity Velocity,
            cz.cuni.amis.pogamut.base3d.worldview.object.Rotation Rotation,
            int Team,
            cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Weapon,
            boolean Shooting,
            int Health,
            int PrimaryAmmo,
            int SecondaryAmmo,
            int Armor,
            int SmallArmor,
            boolean AltFiring,
            boolean Crouched,
            boolean Walking,
            cz.cuni.amis.pogamut.base3d.worldview.object.Location FloorLocation,
            cz.cuni.amis.pogamut.base3d.worldview.object.Location FloorNormal,
            double UDamageTime,
            String Action)
Creates new instance of command Self. Synchronous message. Information about your bot's state. Corresponding GameBots message for this command is .

Parameters:
Id - Unique Id of the bot.
Name - Human readable bot name.
Vehicle - If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health" "Armor", "FloorLocation", "FloorNormal".
Location - An absolute location of the bot.
Velocity - Absolute velocity of the bot as a vector of movement per one game second.
Rotation - Which direction the bot is facing in absolute terms.
Team - What team the bot is on. 255 is no team. 0-3 are red, blue, green, gold in that order.
Weapon - Id of the weapon we are holding. This is unique Id of an item in our inventory and is different from the Id of the item we pick up from the ground! We can parse this string to look which weapon we hold. Weapon strings to look for include: "AssaultRifle", "ShieldGun", "FlakCannon", "BioRifle", "ShockRifle", "LinkGun", "SniperRifle", "RocketLauncher", "Minigun", "LightingGun", "Translocator". TODO: Look if this is all.
Shooting - If the bot is shooting or not.
Health - How much health the bot has left. Starts at 100, ranges from 0 to 200.
PrimaryAmmo - How much ammo the bot has left for current weapon primary mode.
SecondaryAmmo - How much ammo the bot has left for current weapon secondary mode. Weapon does not have to support sec. fire mode.
Armor - Combined size of high armor and low armor (or small armor). The high and low armor are tracked separately. Low armor is limited to 50 points, while the high armor can have up to 150 points. Both stacks can have a combined size of 150 points as well, so if low armor is already at 50 points, high armor can have 100 points at max.
SmallArmor - Also refered to as a "low armor". Ranges from 0 to 50 points.
AltFiring - If we are firing in secondary firing mode.
Crouched - If we are currently crouched.
Walking - If we are currently in walking mode.
FloorLocation - Holds current floor location under the bot.
FloorNormal - Holds current floor normal under the bot.
UDamageTime - Time when the UDamage effect expires. If the number is higher then the current time, it means the bot has UDamage effect active right now.
Action - Name of the current BDI action.

Self

public Self(Self original)
Cloning constructor.


Self

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

Method Detail

getId

public cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getId()
Unique Id of the bot.

Specified by:
getId in interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent
Specified by:
getId in interface cz.cuni.amis.pogamut.base.communication.worldview.object.IWorldObject

getName

public String getName()
Human readable bot name.

Specified by:
getName in interface IPerson

isVehicle

public boolean isVehicle()
If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health" "Armor", "FloorLocation", "FloorNormal".


getLocation

public cz.cuni.amis.pogamut.base3d.worldview.object.Location getLocation()
An absolute location of the bot.

Specified by:
getLocation in interface cz.cuni.amis.pogamut.base3d.worldview.object.ILocated

getVelocity

public cz.cuni.amis.pogamut.base3d.worldview.object.Velocity getVelocity()
Absolute velocity of the bot as a vector of movement per one game second.

Specified by:
getVelocity in interface cz.cuni.amis.pogamut.base3d.worldview.object.ILocomotive

getRotation

public cz.cuni.amis.pogamut.base3d.worldview.object.Rotation getRotation()
Which direction the bot is facing in absolute terms.

Specified by:
getRotation in interface cz.cuni.amis.pogamut.base3d.worldview.object.IRotable

getTeam

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


getWeapon

public cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getWeapon()
Id of the weapon we are holding. This is unique Id of an item in our inventory and is different from the Id of the item we pick up from the ground! We can parse this string to look which weapon we hold. Weapon strings to look for include: "AssaultRifle", "ShieldGun", "FlakCannon", "BioRifle", "ShockRifle", "LinkGun", "SniperRifle", "RocketLauncher", "Minigun", "LightingGun", "Translocator". TODO: Look if this is all.


isShooting

public boolean isShooting()
If the bot is shooting or not.


getHealth

public int getHealth()
How much health the bot has left. Starts at 100, ranges from 0 to 200.


getPrimaryAmmo

public int getPrimaryAmmo()
How much ammo the bot has left for current weapon primary mode.


getSecondaryAmmo

public int getSecondaryAmmo()
How much ammo the bot has left for current weapon secondary mode. Weapon does not have to support sec. fire mode.


getArmor

public int getArmor()
Combined size of high armor and low armor (or small armor). The high and low armor are tracked separately. Low armor is limited to 50 points, while the high armor can have up to 150 points. Both stacks can have a combined size of 150 points as well, so if low armor is already at 50 points, high armor can have 100 points at max.


getSmallArmor

public int getSmallArmor()
Also refered to as a "low armor". Ranges from 0 to 50 points.


isAltFiring

public boolean isAltFiring()
If we are firing in secondary firing mode.


isCrouched

public boolean isCrouched()
If we are currently crouched.


isWalking

public boolean isWalking()
If we are currently in walking mode.


getFloorLocation

public cz.cuni.amis.pogamut.base3d.worldview.object.Location getFloorLocation()
Holds current floor location under the bot.


getFloorNormal

public cz.cuni.amis.pogamut.base3d.worldview.object.Location getFloorNormal()
Holds current floor normal under the bot.


getUDamageTime

public double getUDamageTime()
Time when the UDamage effect expires. If the number is higher then the current time, it means the bot has UDamage effect active right now.


getAction

public String getAction()
Name of the current BDI action.


getTime

protected double getTime()

setTime

protected void setTime(double time)

getLastSeenTime

public double getLastSeenTime()

getLocal

public cz.cuni.amis.pogamut.multi.communication.worldview.object.ILocalWorldObject getLocal()

getShared

public cz.cuni.amis.pogamut.multi.communication.worldview.object.ISharedWorldObject getShared()

getStatic

public cz.cuni.amis.pogamut.multi.communication.worldview.object.IStaticWorldObject getStatic()

getSimTime

public long getSimTime()
Specified by:
getSimTime in interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent
Specified by:
getSimTime in interface cz.cuni.amis.pogamut.base.communication.worldview.object.IWorldObject

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

update

public cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult update(cz.cuni.amis.pogamut.base.communication.worldview.object.IWorldObject obj)
Specified by:
update in interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent

getObject

public cz.cuni.amis.pogamut.base.communication.worldview.object.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 cz.cuni.amis.pogamut.base.communication.messages.InfoMessage

toHtmlString

public String toHtmlString()


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