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

Package class diagram package WeaponUpdate
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.udk.communication.messages.GBEvent
          extended by cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.WeaponUpdate
All Implemented Interfaces:
IWorldChangeEvent, IWorldEventWrapper, IWorldEvent, IGBWorldEvent, cz.cuni.amis.utils.listener.Event

public class WeaponUpdate
extends GBEvent
implements IWorldEvent, IWorldChangeEvent

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.


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  String InventoryType
          Class of the weapon in the inventory.
protected  int PrimaryAmmo
          Holding primary ammo of the old weapon (that was changed).
static 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)
 
Constructor Summary
WeaponUpdate()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
WeaponUpdate(UnrealId Id, int PrimaryAmmo, int SecondaryAmmo, String InventoryType)
          Creates new instance of command WeaponUpdate.
WeaponUpdate(WeaponUpdate original)
          Cloning constructor.
 
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).
 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()
           
 String toHtmlString()
           
 String toString()
           
 
Methods inherited from class cz.cuni.amis.pogamut.udk.communication.messages.GBEvent
getWorldEvent
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

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

See Also:
Constant Field Values

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 String InventoryType
Class of the weapon in the inventory. Matches InventoryType in the item class (ITC) message.

Constructor Detail

WeaponUpdate

public WeaponUpdate(UnrealId Id,
                    int PrimaryAmmo,
                    int SecondaryAmmo,
                    String InventoryType)
Creates new instance of command 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 for this command is .

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.


WeaponUpdate

public WeaponUpdate()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).

Method Detail

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 String getInventoryType()
Class of the weapon in the inventory. Matches InventoryType in the item class (ITC) message.


getSimTime

public long getSimTime()
Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldEvent
Overrides:
getSimTime in class GBEvent

toString

public String toString()
Overrides:
toString in class InfoMessage

toHtmlString

public String toHtmlString()


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