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

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.WeaponUpdate
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, Event

public class WeaponUpdate
extends InfoMessage
implements IWorldEvent, IWorldChangeEvent

Definition of the event WUP.

Complete message documentation: Asynchronous message. Send when the bot changed weapon. Here we will export the status of the old weapon - of the weapon that was changed. So we can have correct info about weapons in our inventory. This could be a problem without this message because of synchronous batch delay.


Field Summary
protected  UnrealId Id
          Unique Id of the weapon, based on the inventory weapon's name (this is different from the Id of the weapon that can be picked up in the map).
protected  java.lang.String InventoryType
          Class of the weapon in the inventory.
protected  int PrimaryAmmo
          Holding primary ammo of the old weapon (that was changed).
static java.lang.String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  int SecondaryAmmo
          Holding secondary ammo of the old weapon (that was changed)
protected  long SimTime
           
 
Constructor Summary
WeaponUpdate()
          Parameter-less contructor for the message.
WeaponUpdate(UnrealId Id, int PrimaryAmmo, int SecondaryAmmo, java.lang.String InventoryType)
          Creates new instance of the message WeaponUpdate.
WeaponUpdate(WeaponUpdate original)
          Cloning constructor from the full message.
 
Method Summary
 UnrealId getId()
          Unique Id of the weapon, based on the inventory weapon's name (this is different from the Id of the weapon that can be picked up in the map).
 java.lang.String getInventoryType()
          Class of the weapon in the inventory.
 int getPrimaryAmmo()
          Holding primary ammo of the old weapon (that was changed).
 int getSecondaryAmmo()
          Holding secondary ammo of the old weapon (that was changed)
 long getSimTime()
          Returns the simulation time when the event has occurred.
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final java.lang.String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

SimTime

protected long SimTime

Id

protected UnrealId Id
Unique Id of the weapon, based on the inventory weapon's name (this is different from the Id of the weapon that can be picked up in the map).


PrimaryAmmo

protected int PrimaryAmmo
Holding primary ammo of the old weapon (that was changed).


SecondaryAmmo

protected int SecondaryAmmo
Holding secondary ammo of the old weapon (that was changed)


InventoryType

protected java.lang.String InventoryType
Class of the weapon in the inventory. Matches InventoryType in the item class (ITC) message.

Constructor Detail

WeaponUpdate

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


WeaponUpdate

public WeaponUpdate(UnrealId Id,
                    int PrimaryAmmo,
                    int SecondaryAmmo,
                    java.lang.String InventoryType)
Creates new instance of the message WeaponUpdate. Asynchronous message. Send when the bot changed weapon. Here we will export the status of the old weapon - of the weapon that was changed. So we can have correct info about weapons in our inventory. This could be a problem without this message because of synchronous batch delay. Corresponding GameBots message is WUP.

Parameters:
Id - Unique Id of the weapon, based on the inventory weapon's name (this is different from the Id of the weapon that can be picked up in the map).
PrimaryAmmo - Holding primary ammo of the old weapon (that was changed).
SecondaryAmmo - Holding secondary ammo of the old weapon (that was changed)
InventoryType - Class of the weapon in the inventory. Matches InventoryType in the item class (ITC) message.

WeaponUpdate

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

Parameters:
original -
Method Detail

getSimTime

public long getSimTime()
Description copied from interface: IWorldEvent
Returns the simulation time when the event has occurred.

Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldEvent
Returns:
timestamp

setSimTime

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


getId

public UnrealId getId()
Unique Id of the weapon, based on the inventory weapon's name (this is different from the Id of the weapon that can be picked up in the map).


getPrimaryAmmo

public int getPrimaryAmmo()
Holding primary ammo of the old weapon (that was changed).


getSecondaryAmmo

public int getSecondaryAmmo()
Holding secondary ammo of the old weapon (that was changed)


getInventoryType

public java.lang.String getInventoryType()
Class of the weapon in the inventory. Matches InventoryType in the item class (ITC) message.


toString

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

toHtmlString

public java.lang.String toHtmlString()