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

Package class diagram package SelfCompositeImpl
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.SelfCompositeImpl
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, IWorldObject, ILocated, ILocomotive, IRotable, ICompositeWorldObject, IPerson, cz.cuni.amis.utils.listener.Event

public class SelfCompositeImpl
extends Self

Composite implementation of the SLF abstract message. It wraps Local/Shared/Static parts in single object allowing to presenting a nice facade for users.

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


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self
Self.SelfUpdate
 
Field Summary
protected  SelfLocalImpl partLocal
           
protected  SelfStaticImpl partStatic
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self
PROTOTYPE, SimTime
 
Constructor Summary
SelfCompositeImpl()
          Parameter-less contructor for the message.
SelfCompositeImpl(SelfCompositeImpl original)
          Cloning constructor.
SelfCompositeImpl(SelfLocalImpl partLocal, SelfSharedImpl partShared, SelfStaticImpl partStatic)
          Composite-impl constructor.
 
Method Summary
 String getAction()
          Name of the current BDI action.
 int getAdrenaline()
          How much adrenaline the bot has.
 String getAnim()
          For UE2.
 int getArmor()
          Combined size of high armor and low armor (or small armor).
 UnrealId getBotId()
          Unique Id of this bot.
 String getBubble()
          For UE2.
 String getCombo()
          Name of the current combo (None if no combo active).
 String getEmotCenter()
          For UE2.
 String getEmotLeft()
          For UE2.
 String getEmotRight()
          For UE2.
 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 this self message instance.
 SelfLocal getLocal()
           
 Location getLocation()
          An absolute location of the bot.
 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. 255 is no team. 0-3 are red, blue, green, gold in that order.
 double getUDamageTime()
          Time when the UDamage effect expires.
 Velocity getVelocity()
          Absolute velocity of the bot as a vector of movement per one game second.
 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. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health" "Armor","Adrenaline", "FloorLocation", "FloorNormal".
 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.
 String toHtmlString()
           
 String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self
getSimTime, toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

partStatic

protected SelfStaticImpl partStatic

partLocal

protected SelfLocalImpl partLocal
Constructor Detail

SelfCompositeImpl

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


SelfCompositeImpl

public SelfCompositeImpl(SelfLocalImpl partLocal,
                         SelfSharedImpl partShared,
                         SelfStaticImpl partStatic)
Composite-impl constructor. It assembles the message from its three fragments - local/shared/static.

Parameters:
partLocal - local-part of the message
partShared - shared-part of the message
partStatic - static-part of the message

SelfCompositeImpl

public SelfCompositeImpl(SelfCompositeImpl original)
Cloning constructor.

Parameters:
original -
Method Detail

setSimTime

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

Overrides:
setSimTime in class Self

getStatic

public SelfStatic getStatic()

getLocal

public SelfLocal getLocal()

getShared

public SelfShared getShared()

getId

public UnrealId getId()
Description copied from class: Self
Unique Id of this self message instance.

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

getBotId

public UnrealId getBotId()
Description copied from class: Self
Unique Id of this bot.

Specified by:
getBotId in class Self

getName

public 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

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

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

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 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 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 String getAction()
Description copied from class: Self
Name of the current BDI action.

Specified by:
getAction in class Self

getEmotLeft

public String getEmotLeft()
Description copied from class: Self
For UE2. Holds left emoticon of the bot, "None" means none set.

Specified by:
getEmotLeft in class Self

getEmotCenter

public String getEmotCenter()
Description copied from class: Self
For UE2. Holds center emoticon of the bot, "None" means none set.

Specified by:
getEmotCenter in class Self

getEmotRight

public String getEmotRight()
Description copied from class: Self
For UE2. Holds right emoticon of the bot, "None" means none set.

Specified by:
getEmotRight in class Self

getBubble

public String getBubble()
Description copied from class: Self
For UE2. Holds the bubble of the emoticon of the bot, "None" means none set.

Specified by:
getBubble in class Self

getAnim

public String getAnim()
Description copied from class: Self
For UE2. Current played animation of the bot.

Specified by:
getAnim in class Self

toString

public String toString()
Overrides:
toString in class Self

toHtmlString

public String toHtmlString()
Overrides:
toHtmlString in class Self


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