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

Package class diagram package ChangedWeapon
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.ChangedWeapon
All Implemented Interfaces:
IWorldChangeEvent, IWorldEventWrapper, IWorldEvent, IGBWorldEvent, cz.cuni.amis.utils.listener.Event

public class ChangedWeapon
extends GBEvent
implements IWorldEvent, IWorldChangeEvent

Asynchronous message. Bot changed weapon. Possibly as a result of a command sent by you. Here we will get the new weapon - the weapon the bot has changed to. Corresponding GameBots message is CWP.


Field Summary
protected  String Id
          Unique Id of new 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  int PrimaryAmmo
          Holding current primary ammo of the new weapon.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  int SecondaryAmmo
          Holding current secondary ammo of the new weapon.
protected  String Type
          A string representing the type of the weapon.
 
Constructor Summary
ChangedWeapon()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
ChangedWeapon(ChangedWeapon original)
          Cloning constructor.
ChangedWeapon(String Id, int PrimaryAmmo, int SecondaryAmmo, String Type)
          Creates new instance of command ChangedWeapon.
 
Method Summary
 String getId()
          Unique Id of new 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).
 int getPrimaryAmmo()
          Holding current primary ammo of the new weapon.
 int getSecondaryAmmo()
          Holding current secondary ammo of the new weapon.
 long getSimTime()
           
 String getType()
          A string representing the type of the weapon.
 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 String Id
Unique Id of new 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 current primary ammo of the new weapon.


SecondaryAmmo

protected int SecondaryAmmo
Holding current secondary ammo of the new weapon.


Type

protected String Type
A string representing the type of the weapon.

Constructor Detail

ChangedWeapon

public ChangedWeapon(String Id,
                     int PrimaryAmmo,
                     int SecondaryAmmo,
                     String Type)
Creates new instance of command ChangedWeapon. Asynchronous message. Bot changed weapon. Possibly as a result of a command sent by you. Here we will get the new weapon - the weapon the bot has changed to. Corresponding GameBots message for this command is .

Parameters:
Id - Unique Id of new 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 current primary ammo of the new weapon.
SecondaryAmmo - Holding current secondary ammo of the new weapon.
Type - A string representing the type of the weapon.

ChangedWeapon

public ChangedWeapon(ChangedWeapon original)
Cloning constructor.


ChangedWeapon

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

Method Detail

getId

public String getId()
Unique Id of new 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 current primary ammo of the new weapon.


getSecondaryAmmo

public int getSecondaryAmmo()
Holding current secondary ammo of the new weapon.


getType

public String getType()
A string representing the type of the weapon.


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 © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.