cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages
Class SelfMessage

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self
          extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.SelfMessage
All Implemented Interfaces:
IWorldChangeEvent, IWorldObjectUpdatedEvent, IWorldEvent, IWorldObject, ILocated, ILocomotive, IRotable, ICompositeWorldObject, IPerson, Event

public class SelfMessage
extends Self
implements IWorldObjectUpdatedEvent

Implementation of the GameBots2004 message SLF contains also its Local/Shared/Static subpart class definitions..

Complete message documentation: Synchronous message. Information about your bot's state.


Nested Class Summary
 class SelfMessage.SelfLocalMessage
          Implementation of the local part of the GameBots2004 message SLF, used to facade SLFMessage.
 class SelfMessage.SelfSharedMessage
          Implementation of the shared part of the GameBots2004 message SLF, used to facade SLFMessage.
 class SelfMessage.SelfStaticMessage
          Implementation of the static part of the GameBots2004 message SLF, used to facade SLFMessage.
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self
Self.SelfUpdate
 
Field Summary
protected  java.lang.String Action
          Name of the current BDI action.
protected  int Adrenaline
          How much adrenaline the bot has.
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  UnrealId BotId
          Unique Id of the observed bot.
protected  java.lang.String Combo
          Name of the current combo (None if no combo active).
protected  boolean Crouched
          If we are currently crouched.
protected  Location FloorLocation
          Holds current floor location under the bot.
protected  Location FloorNormal
          Holds current floor normal under the bot.
protected  int Health
          How much health the bot has left.
protected  UnrealId Id
          Unique Id of the bot.
protected  Location Location
          An absolute location of the bot.
protected  java.lang.String Name
          Human readable bot name.
protected  int PrimaryAmmo
          How much ammo the bot has left for current weapon primary mode.
protected  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.
protected  ITeamId TeamId
           
protected  double UDamageTime
          Time when the UDamage effect expires.
protected  boolean Vehicle
          If we are vehicle just these attr.
protected  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  java.lang.String Weapon
          Id of the weapon we are holding.
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self
PROTOTYPE, SimTime
 
Constructor Summary
SelfMessage()
          Parameter-less contructor for the message.
SelfMessage(SelfMessage original)
          Cloning constructor from the full message.
SelfMessage(UnrealId Id, UnrealId BotId, java.lang.String Name, boolean Vehicle, Location Location, Velocity Velocity, Rotation Rotation, int Team, java.lang.String Weapon, boolean Shooting, int Health, int PrimaryAmmo, int SecondaryAmmo, int Adrenaline, int Armor, int SmallArmor, boolean AltFiring, boolean Crouched, boolean Walking, Location FloorLocation, Location FloorNormal, java.lang.String Combo, double UDamageTime, java.lang.String Action)
          Creates new instance of the message Self.
 
Method Summary
 java.lang.String getAction()
          Name of the current BDI action.
 int getAdrenaline()
          How much adrenaline the bot has.
 int getArmor()
          Combined size of high armor and low armor (or small armor).
 UnrealId getBotId()
          Unique Id of the observed bot.
 java.lang.String getCombo()
          Name of the current combo (None if no combo active).
 Location getFloorLocation()
          Holds current floor location under the bot.
 Location getFloorNormal()
          Holds current floor normal under the bot.
 int getHealth()
          How much health the bot has left.
 UnrealId getId()
          Unique Id of the bot.
 SelfLocal getLocal()
           
 Location getLocation()
          An absolute location of the bot.
 java.lang.String getName()
          Human readable bot name.
 int getPrimaryAmmo()
          How much ammo the bot has left for current weapon primary mode.
 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.
 SelfShared getShared()
           
 int getSmallArmor()
          Also refered to as a "low armor".
 SelfStatic getStatic()
           
 int getTeam()
          What team the bot is on.
 ITeamId getTeamId()
           
 double getUDamageTime()
          Time when the UDamage effect expires.
 Velocity getVelocity()
          Absolute velocity of the bot as a vector of movement per one game second.
 java.lang.String getWeapon()
          Id of the weapon we are holding.
 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.
 boolean isWalking()
          If we are currently in walking mode.
protected  void setTeamId(ITeamId TeamId)
          Used by Yylex to slip corretn TeamId.
 java.lang.String toHtmlString()
           
 java.lang.String toString()
           
 IWorldObjectUpdateResult<IWorldObject> update(IWorldObject object)
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self
getSimTime, setSimTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent
getSimTime
 

Field Detail

TeamId

protected ITeamId TeamId

Id

protected UnrealId Id
Unique Id of the bot.


BotId

protected UnrealId BotId
Unique Id of the observed bot. Sent only for observers, note that observers has different Id in Self.Id than bots.


Name

protected java.lang.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","Adrenaline", "FloorLocation", "FloorNormal".


Location

protected Location Location
An absolute location of the bot.


Velocity

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


Rotation

protected 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 java.lang.String 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.


Adrenaline

protected int Adrenaline
How much adrenaline the bot has.


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 Location FloorLocation
Holds current floor location under the bot.


FloorNormal

protected Location FloorNormal
Holds current floor normal under the bot.


Combo

protected java.lang.String Combo
Name of the current combo (None if no combo active). Can be xGame.ComboBerserk, xGame.ComboDefensive, xGame.ComboInvis or xGame.ComboSpeed. To trigger combo adrenaline needs to be at 100 (maximum) and no other combo can be active.


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 java.lang.String Action
Name of the current BDI action.

Constructor Detail

SelfMessage

public SelfMessage()
Parameter-less contructor for the message.


SelfMessage

public SelfMessage(UnrealId Id,
                   UnrealId BotId,
                   java.lang.String Name,
                   boolean Vehicle,
                   Location Location,
                   Velocity Velocity,
                   Rotation Rotation,
                   int Team,
                   java.lang.String Weapon,
                   boolean Shooting,
                   int Health,
                   int PrimaryAmmo,
                   int SecondaryAmmo,
                   int Adrenaline,
                   int Armor,
                   int SmallArmor,
                   boolean AltFiring,
                   boolean Crouched,
                   boolean Walking,
                   Location FloorLocation,
                   Location FloorNormal,
                   java.lang.String Combo,
                   double UDamageTime,
                   java.lang.String Action)
Creates new instance of the message Self. Synchronous message. Information about your bot's state. Corresponding GameBots message is SLF.

Parameters:
Id - Unique Id of the bot.
BotId - Unique Id of the observed bot. Sent only for observers, note that observers has different Id in Self.Id than bots.
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","Adrenaline", "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.
Adrenaline - How much adrenaline the bot has.
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.
Combo - Name of the current combo (None if no combo active). Can be xGame.ComboBerserk, xGame.ComboDefensive, xGame.ComboInvis or xGame.ComboSpeed. To trigger combo adrenaline needs to be at 100 (maximum) and no other combo can be active.
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.

SelfMessage

public SelfMessage(SelfMessage original)
Cloning constructor from the full message.

Parameters:
original -
Method Detail

setTeamId

protected void setTeamId(ITeamId TeamId)
Used by Yylex to slip corretn TeamId.


getTeamId

public ITeamId getTeamId()

getId

public UnrealId getId()
Description copied from class: Self
Unique Id of the bot.

Specified by:
getId in interface IWorldObjectUpdatedEvent
Specified by:
getId in interface IWorldObject
Specified by:
getId in class Self
Returns:

getBotId

public UnrealId getBotId()
Description copied from class: Self
Unique Id of the observed bot. Sent only for observers, note that observers has different Id in Self.Id than bots.

Specified by:
getBotId in class Self

getName

public java.lang.String getName()
Description copied from class: Self
Human readable bot name.

Specified by:
getName in interface IPerson
Specified by:
getName in class Self

isVehicle

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

Specified by:
isVehicle in class Self

getLocation

public Location getLocation()
Description copied from class: Self
An absolute location of the bot.

Specified by:
getLocation in interface ILocated
Specified by:
getLocation in class Self
Returns:
Current location of the object, represented as a point within the world's coordinates.

getVelocity

public Velocity getVelocity()
Description copied from class: Self
Absolute velocity of the bot as a vector of movement per one game second.

Specified by:
getVelocity in interface ILocomotive
Specified by:
getVelocity in class Self
Returns:
Current direction in which the object is moving and absolute velocity of the object within the world. The direction is represented as a vector within the world's coordinates. The size of velocity is represented by length of that vector.

getRotation

public Rotation getRotation()
Description copied from class: Self
Which direction the bot is facing in absolute terms.

Specified by:
getRotation in interface IRotable
Specified by:
getRotation in class Self
Returns:
Current rotation of the object, represented as yaw, roll and pitch.

getTeam

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

Specified by:
getTeam in class Self

getWeapon

public java.lang.String getWeapon()
Description copied from class: Self
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.

Specified by:
getWeapon in class Self

isShooting

public boolean isShooting()
Description copied from class: Self
If the bot is shooting or not.

Specified by:
isShooting in class Self

getHealth

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

Specified by:
getHealth in class Self

getPrimaryAmmo

public int getPrimaryAmmo()
Description copied from class: Self
How much ammo the bot has left for current weapon primary mode.

Specified by:
getPrimaryAmmo in class Self

getSecondaryAmmo

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

Specified by:
getSecondaryAmmo in class Self

getAdrenaline

public int getAdrenaline()
Description copied from class: Self
How much adrenaline the bot has.

Specified by:
getAdrenaline in class Self

getArmor

public int getArmor()
Description copied from class: Self
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.

Specified by:
getArmor in class Self

getSmallArmor

public int getSmallArmor()
Description copied from class: Self
Also refered to as a "low armor". Ranges from 0 to 50 points.

Specified by:
getSmallArmor in class Self

isAltFiring

public boolean isAltFiring()
Description copied from class: Self
If we are firing in secondary firing mode.

Specified by:
isAltFiring in class Self

isCrouched

public boolean isCrouched()
Description copied from class: Self
If we are currently crouched.

Specified by:
isCrouched in class Self

isWalking

public boolean isWalking()
Description copied from class: Self
If we are currently in walking mode.

Specified by:
isWalking in class Self

getFloorLocation

public Location getFloorLocation()
Description copied from class: Self
Holds current floor location under the bot.

Specified by:
getFloorLocation in class Self

getFloorNormal

public Location getFloorNormal()
Description copied from class: Self
Holds current floor normal under the bot.

Specified by:
getFloorNormal in class Self

getCombo

public java.lang.String getCombo()
Description copied from class: Self
Name of the current combo (None if no combo active). Can be xGame.ComboBerserk, xGame.ComboDefensive, xGame.ComboInvis or xGame.ComboSpeed. To trigger combo adrenaline needs to be at 100 (maximum) and no other combo can be active.

Specified by:
getCombo in class Self

getUDamageTime

public double getUDamageTime()
Description copied from class: Self
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.

Specified by:
getUDamageTime in class Self

getAction

public java.lang.String getAction()
Description copied from class: Self
Name of the current BDI action.

Specified by:
getAction in class Self

getLocal

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

getShared

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

getStatic

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

update

public IWorldObjectUpdateResult<IWorldObject> update(IWorldObject object)
Specified by:
update in interface IWorldObjectUpdatedEvent

toString

public java.lang.String toString()
Overrides:
toString in class Self

toHtmlString

public java.lang.String toHtmlString()
Overrides:
toHtmlString in class Self