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

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.SelfShared
All Implemented Interfaces:
IWorldObject, ISharedWorldObject, java.lang.Cloneable
Direct Known Subclasses:
SelfMessage.SelfSharedMessage, SelfSharedImpl

public abstract class SelfShared
extends InfoMessage
implements ISharedWorldObject

Abstract definition of the shared part of the GameBots2004 message SLF.

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


Field Summary
static Token ActionPropertyToken
           
static Token AdrenalinePropertyToken
           
static Token AltFiringPropertyToken
           
static Token ArmorPropertyToken
           
static Token BotIdPropertyToken
           
static Token ComboPropertyToken
           
static Token CrouchedPropertyToken
           
static Token FloorLocationPropertyToken
           
static Token FloorNormalPropertyToken
           
static Token HealthPropertyToken
           
static Token LocationPropertyToken
           
static Token NamePropertyToken
           
static Token PrimaryAmmoPropertyToken
           
static Token RotationPropertyToken
           
static Token SecondaryAmmoPropertyToken
           
static java.util.Set<Token> SharedPropertyTokens
           
static Token ShootingPropertyToken
           
protected  long SimTime
           
static Token SmallArmorPropertyToken
           
static Token TeamPropertyToken
           
static Token UDamageTimePropertyToken
           
static Token VehiclePropertyToken
           
static Token VelocityPropertyToken
           
static Token WalkingPropertyToken
           
static Token WeaponPropertyToken
           
 
Constructor Summary
SelfShared()
          Parameter-less contructor for the message.
 
Method Summary
abstract  SelfShared clone()
           
abstract  java.lang.String getAction()
          Name of the current BDI action.
abstract  int getAdrenaline()
          How much adrenaline the bot has.
abstract  int getArmor()
          Combined size of high armor and low armor (or small armor).
abstract  UnrealId getBotId()
          Unique Id of the observed bot.
abstract  java.lang.String getCombo()
          Name of the current combo (None if no combo active).
 java.lang.Class getCompositeClass()
           
abstract  Location getFloorLocation()
          Holds current floor location under the bot.
abstract  Location getFloorNormal()
          Holds current floor normal under the bot.
abstract  int getHealth()
          How much health the bot has left.
abstract  UnrealId getId()
          Unique Id of the bot.
abstract  Location getLocation()
          An absolute location of the bot.
abstract  java.lang.String getName()
          Human readable bot name.
abstract  int getPrimaryAmmo()
          How much ammo the bot has left for current weapon primary mode.
abstract  Rotation getRotation()
          Which direction the bot is facing in absolute terms.
abstract  int getSecondaryAmmo()
          How much ammo the bot has left for current weapon secondary mode.
 long getSimTime()
          Returns world time when the object was seen/updated for the last time.
abstract  int getSmallArmor()
          Also refered to as a "low armor".
abstract  int getTeam()
          What team the bot is on.
abstract  double getUDamageTime()
          Time when the UDamage effect expires.
abstract  Velocity getVelocity()
          Absolute velocity of the bot as a vector of movement per one game second.
abstract  java.lang.String getWeapon()
          Id of the weapon we are holding.
abstract  boolean isAltFiring()
          If we are firing in secondary firing mode.
abstract  boolean isCrouched()
          If we are currently crouched.
abstract  boolean isShooting()
          If the bot is shooting or not.
abstract  boolean isVehicle()
          If we are vehicle just these attr.
abstract  boolean isWalking()
          If we are currently in walking mode.
protected  void setSimTime(long SimTime)
          Used by Yylex to slip correct time of the object or programmatically.
 java.lang.String toHtmlString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface cz.cuni.amis.pogamut.multi.communication.worldview.object.ISharedWorldObject
getProperties, getProperty
 

Field Detail

SimTime

protected long SimTime

BotIdPropertyToken

public static final Token BotIdPropertyToken

NamePropertyToken

public static final Token NamePropertyToken

VehiclePropertyToken

public static final Token VehiclePropertyToken

LocationPropertyToken

public static final Token LocationPropertyToken

VelocityPropertyToken

public static final Token VelocityPropertyToken

RotationPropertyToken

public static final Token RotationPropertyToken

TeamPropertyToken

public static final Token TeamPropertyToken

WeaponPropertyToken

public static final Token WeaponPropertyToken

ShootingPropertyToken

public static final Token ShootingPropertyToken

HealthPropertyToken

public static final Token HealthPropertyToken

PrimaryAmmoPropertyToken

public static final Token PrimaryAmmoPropertyToken

SecondaryAmmoPropertyToken

public static final Token SecondaryAmmoPropertyToken

AdrenalinePropertyToken

public static final Token AdrenalinePropertyToken

ArmorPropertyToken

public static final Token ArmorPropertyToken

SmallArmorPropertyToken

public static final Token SmallArmorPropertyToken

AltFiringPropertyToken

public static final Token AltFiringPropertyToken

CrouchedPropertyToken

public static final Token CrouchedPropertyToken

WalkingPropertyToken

public static final Token WalkingPropertyToken

FloorLocationPropertyToken

public static final Token FloorLocationPropertyToken

FloorNormalPropertyToken

public static final Token FloorNormalPropertyToken

ComboPropertyToken

public static final Token ComboPropertyToken

UDamageTimePropertyToken

public static final Token UDamageTimePropertyToken

ActionPropertyToken

public static final Token ActionPropertyToken

SharedPropertyTokens

public static final java.util.Set<Token> SharedPropertyTokens
Constructor Detail

SelfShared

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

Method Detail

getSimTime

public long getSimTime()
Description copied from interface: ISharedWorldObject
Returns world time when the object was seen/updated for the last time.

The time suppose to be growing as the simulation carries on.

Always should be actual_timestamp >= any_prevously_recorded_timestamp,

object1.getLastSeenTime() > object2.getLastSeenTime() means that object1 last seen after object2

Specified by:
getSimTime in interface IWorldObject
Specified by:
getSimTime in interface ISharedWorldObject
Returns:

setSimTime

protected void setSimTime(long SimTime)
Used by Yylex to slip correct time of the object or programmatically.


clone

public abstract SelfShared clone()
Specified by:
clone in interface ISharedWorldObject
Overrides:
clone in class java.lang.Object

getCompositeClass

public java.lang.Class getCompositeClass()
Specified by:
getCompositeClass in interface ISharedWorldObject

getId

public abstract UnrealId getId()
Unique Id of the bot.

Specified by:
getId in interface IWorldObject
Returns:

getBotId

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


getName

public abstract java.lang.String getName()
Human readable bot name.


isVehicle

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


getLocation

public abstract Location getLocation()
An absolute location of the bot.


getVelocity

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


getRotation

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


getTeam

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


getWeapon

public abstract java.lang.String 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 abstract boolean isShooting()
If the bot is shooting or not.


getHealth

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


getPrimaryAmmo

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


getSecondaryAmmo

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


getAdrenaline

public abstract int getAdrenaline()
How much adrenaline the bot has.


getArmor

public abstract 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 abstract int getSmallArmor()
Also refered to as a "low armor". Ranges from 0 to 50 points.


isAltFiring

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


isCrouched

public abstract boolean isCrouched()
If we are currently crouched.


isWalking

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


getFloorLocation

public abstract Location getFloorLocation()
Holds current floor location under the bot.


getFloorNormal

public abstract Location getFloorNormal()
Holds current floor normal under the bot.


getCombo

public abstract java.lang.String getCombo()
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.


getUDamageTime

public abstract 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 abstract java.lang.String getAction()
Name of the current BDI action.


toString

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

toHtmlString

public java.lang.String toHtmlString()