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

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

public class SelfSharedImpl
extends SelfShared

Implementation of the shared part of the GameBots2004 message SLF.

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


Nested Class Summary
static class SelfSharedImpl.SelfSharedUpdate
           
 
Field Summary
protected  UnrealId Id
          Unique Id of the bot.
protected  StringProperty myAction
          Name of the current BDI action.
protected  IntProperty myAdrenaline
          How much adrenaline the bot has.
protected  BooleanProperty myAltFiring
          If we are firing in secondary firing mode.
protected  IntProperty myArmor
          Combined size of high armor and low armor (or small armor).
protected  UnrealIdProperty myBotId
          Unique Id of the observed bot.
protected  StringProperty myCombo
          Name of the current combo (None if no combo active).
protected  BooleanProperty myCrouched
          If we are currently crouched.
protected  LocationProperty myFloorLocation
          Holds current floor location under the bot.
protected  LocationProperty myFloorNormal
          Holds current floor normal under the bot.
protected  IntProperty myHealth
          How much health the bot has left.
protected  LocationProperty myLocation
          An absolute location of the bot.
protected  StringProperty myName
          Human readable bot name.
protected  IntProperty myPrimaryAmmo
          How much ammo the bot has left for current weapon primary mode.
protected  RotationProperty myRotation
          Which direction the bot is facing in absolute terms.
protected  IntProperty mySecondaryAmmo
          How much ammo the bot has left for current weapon secondary mode.
protected  BooleanProperty myShooting
          If the bot is shooting or not.
protected  IntProperty mySmallArmor
          Also refered to as a "low armor".
protected  IntProperty myTeam
          What team the bot is on.
protected  DoubleProperty myUDamageTime
          Time when the UDamage effect expires.
protected  BooleanProperty myVehicle
          If we are vehicle just these attr.
protected  VelocityProperty myVelocity
          Absolute velocity of the bot as a vector of movement per one game second.
protected  BooleanProperty myWalking
          If we are currently in walking mode.
protected  StringProperty myWeapon
          Id of the weapon we are holding.
protected  java.util.HashMap<PropertyId,ISharedProperty> propertyMap
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.SelfShared
ActionPropertyToken, AdrenalinePropertyToken, AltFiringPropertyToken, ArmorPropertyToken, BotIdPropertyToken, ComboPropertyToken, CrouchedPropertyToken, FloorLocationPropertyToken, FloorNormalPropertyToken, HealthPropertyToken, LocationPropertyToken, NamePropertyToken, PrimaryAmmoPropertyToken, RotationPropertyToken, SecondaryAmmoPropertyToken, SharedPropertyTokens, ShootingPropertyToken, SimTime, SmallArmorPropertyToken, TeamPropertyToken, UDamageTimePropertyToken, VehiclePropertyToken, VelocityPropertyToken, WalkingPropertyToken, WeaponPropertyToken
 
Constructor Summary
SelfSharedImpl(SelfSharedImpl source)
           
SelfSharedImpl(WorldObjectId objectId, java.util.Collection<ISharedProperty> properties)
           
 
Method Summary
 SelfSharedImpl clone()
           
 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.
 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.
 java.util.Map<PropertyId,ISharedProperty> getProperties()
           
 ISharedProperty getProperty(PropertyId id)
           
 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.
 int getSmallArmor()
          Also refered to as a "low armor".
 int getTeam()
          What team the bot is on.
 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.
 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 cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.SelfShared
getCompositeClass, getSimTime
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

propertyMap

protected java.util.HashMap<PropertyId,ISharedProperty> propertyMap

Id

protected UnrealId Id
Unique Id of the bot.


myBotId

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


myName

protected StringProperty myName
Human readable bot name.


myVehicle

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


myLocation

protected LocationProperty myLocation
An absolute location of the bot.


myVelocity

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


myRotation

protected RotationProperty myRotation
Which direction the bot is facing in absolute terms.


myTeam

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


myWeapon

protected StringProperty myWeapon
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.


myShooting

protected BooleanProperty myShooting
If the bot is shooting or not.


myHealth

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


myPrimaryAmmo

protected IntProperty myPrimaryAmmo
How much ammo the bot has left for current weapon primary mode.


mySecondaryAmmo

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


myAdrenaline

protected IntProperty myAdrenaline
How much adrenaline the bot has.


myArmor

protected IntProperty myArmor
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.


mySmallArmor

protected IntProperty mySmallArmor
Also refered to as a "low armor". Ranges from 0 to 50 points.


myAltFiring

protected BooleanProperty myAltFiring
If we are firing in secondary firing mode.


myCrouched

protected BooleanProperty myCrouched
If we are currently crouched.


myWalking

protected BooleanProperty myWalking
If we are currently in walking mode.


myFloorLocation

protected LocationProperty myFloorLocation
Holds current floor location under the bot.


myFloorNormal

protected LocationProperty myFloorNormal
Holds current floor normal under the bot.


myCombo

protected StringProperty myCombo
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.


myUDamageTime

protected DoubleProperty myUDamageTime
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.


myAction

protected StringProperty myAction
Name of the current BDI action.

Constructor Detail

SelfSharedImpl

public SelfSharedImpl(SelfSharedImpl source)

SelfSharedImpl

public SelfSharedImpl(WorldObjectId objectId,
                      java.util.Collection<ISharedProperty> properties)
Method Detail

setSimTime

public void setSimTime(long SimTime)
Description copied from class: SelfShared
Used by Yylex to slip correct time of the object or programmatically.

Overrides:
setSimTime in class SelfShared

clone

public SelfSharedImpl clone()
Specified by:
clone in interface ISharedWorldObject
Specified by:
clone in class SelfShared

getProperty

public ISharedProperty getProperty(PropertyId id)

getProperties

public java.util.Map<PropertyId,ISharedProperty> getProperties()

getId

public UnrealId getId()
Unique Id of the bot.

Specified by:
getId in interface IWorldObject
Specified by:
getId in class SelfShared
Returns:

getBotId

public UnrealId getBotId()
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 SelfShared

getName

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

Specified by:
getName in class SelfShared

isVehicle

public 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".

Specified by:
isVehicle in class SelfShared

getLocation

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

Specified by:
getLocation in class SelfShared

getVelocity

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

Specified by:
getVelocity in class SelfShared

getRotation

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

Specified by:
getRotation in class SelfShared

getTeam

public int getTeam()
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 SelfShared

getWeapon

public 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.

Specified by:
getWeapon in class SelfShared

isShooting

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

Specified by:
isShooting in class SelfShared

getHealth

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

Specified by:
getHealth in class SelfShared

getPrimaryAmmo

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

Specified by:
getPrimaryAmmo in class SelfShared

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.

Specified by:
getSecondaryAmmo in class SelfShared

getAdrenaline

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

Specified by:
getAdrenaline in class SelfShared

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.

Specified by:
getArmor in class SelfShared

getSmallArmor

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

Specified by:
getSmallArmor in class SelfShared

isAltFiring

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

Specified by:
isAltFiring in class SelfShared

isCrouched

public boolean isCrouched()
If we are currently crouched.

Specified by:
isCrouched in class SelfShared

isWalking

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

Specified by:
isWalking in class SelfShared

getFloorLocation

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

Specified by:
getFloorLocation in class SelfShared

getFloorNormal

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

Specified by:
getFloorNormal in class SelfShared

getCombo

public 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.

Specified by:
getCombo in class SelfShared

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.

Specified by:
getUDamageTime in class SelfShared

getAction

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

Specified by:
getAction in class SelfShared

toString

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

toHtmlString

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