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

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

public class AddInventoryMsg
extends InfoMessage
implements IWorldEvent, IWorldChangeEvent

Definition of the event AIN.

Complete message documentation: Asynchronous message. Sent when we get new weapon or ammunition for weapon we do not have yet. Sent just once per weapon type or per new ammunition type (notify new object in our inventory, NOT pickup). The Id of the object (Inventory Id) here is different from the object that is lying on the ground and represents this item in the map (Pickup id). If you want to listen to every item pickup use ItemPickedUp message!


Field Summary
protected  ItemDescriptor Descriptor
          Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
protected  UnrealId Id
          A unique Id for this inventory item, assigned by the game.
protected  int MaxPrimaryAmmo
          If the item is a weapon, contains information how much primary ammo the weapon may have.
protected  int MaxSecondaryAmmo
          If the item is a weapon, contains information how much secondary ammo the weapon may have.
protected  java.lang.Boolean Melee
          If the item is a weapon, contains information whether this weapon is a melee weapon.
protected  ItemType PickupType
          We get this item if we pick up this pickup class in the map.
protected  int PrimaryInitialAmmo
          If the item is a weapon, contains information how much primary ammo the weapon initial has.
static java.lang.String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  int SecondaryInitialAmmo
          If the item is a weapon, contains information how much secondary ammo the weapon initial has.
protected  long SimTime
           
protected  java.lang.Boolean Sniping
          If the item is a weapon, contains information whether this weapon is good for sniping.
protected  java.lang.String Type
          A string representing type (inventory type) of the object.
 
Constructor Summary
AddInventoryMsg()
          Parameter-less contructor for the message.
AddInventoryMsg(AddInventoryMsg original)
          Cloning constructor from the full message.
AddInventoryMsg(UnrealId Id, java.lang.String Type, ItemDescriptor Descriptor, ItemType PickupType, java.lang.Boolean Sniping, java.lang.Boolean Melee, int PrimaryInitialAmmo, int MaxPrimaryAmmo, int SecondaryInitialAmmo, int MaxSecondaryAmmo)
          Creates new instance of the message AddInventoryMsg.
 
Method Summary
 ItemDescriptor getDescriptor()
          Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
 UnrealId getId()
          A unique Id for this inventory item, assigned by the game.
 int getMaxPrimaryAmmo()
          If the item is a weapon, contains information how much primary ammo the weapon may have.
 int getMaxSecondaryAmmo()
          If the item is a weapon, contains information how much secondary ammo the weapon may have.
 ItemType getPickupType()
          We get this item if we pick up this pickup class in the map.
 int getPrimaryInitialAmmo()
          If the item is a weapon, contains information how much primary ammo the weapon initial has.
 int getSecondaryInitialAmmo()
          If the item is a weapon, contains information how much secondary ammo the weapon initial has.
 long getSimTime()
          Returns the simulation time when the event has occurred.
 java.lang.String getType()
          A string representing type (inventory type) of the object.
 java.lang.Boolean isMelee()
          If the item is a weapon, contains information whether this weapon is a melee weapon.
 java.lang.Boolean isSniping()
          If the item is a weapon, contains information whether this weapon is good for sniping.
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
A unique Id for this inventory item, assigned by the game. Unique, but based on a string describing the item type.


Type

protected java.lang.String Type
A string representing type (inventory type) of the object.


Descriptor

protected ItemDescriptor Descriptor
Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.


PickupType

protected ItemType PickupType
We get this item if we pick up this pickup class in the map.


Sniping

protected java.lang.Boolean Sniping
If the item is a weapon, contains information whether this weapon is good for sniping.


Melee

protected java.lang.Boolean Melee
If the item is a weapon, contains information whether this weapon is a melee weapon.


PrimaryInitialAmmo

protected int PrimaryInitialAmmo
If the item is a weapon, contains information how much primary ammo the weapon initial has.


MaxPrimaryAmmo

protected int MaxPrimaryAmmo
If the item is a weapon, contains information how much primary ammo the weapon may have.


SecondaryInitialAmmo

protected int SecondaryInitialAmmo
If the item is a weapon, contains information how much secondary ammo the weapon initial has.


MaxSecondaryAmmo

protected int MaxSecondaryAmmo
If the item is a weapon, contains information how much secondary ammo the weapon may have.

Constructor Detail

AddInventoryMsg

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


AddInventoryMsg

public AddInventoryMsg(UnrealId Id,
                       java.lang.String Type,
                       ItemDescriptor Descriptor,
                       ItemType PickupType,
                       java.lang.Boolean Sniping,
                       java.lang.Boolean Melee,
                       int PrimaryInitialAmmo,
                       int MaxPrimaryAmmo,
                       int SecondaryInitialAmmo,
                       int MaxSecondaryAmmo)
Creates new instance of the message AddInventoryMsg. Asynchronous message. Sent when we get new weapon or ammunition for weapon we do not have yet. Sent just once per weapon type or per new ammunition type (notify new object in our inventory, NOT pickup). The Id of the object (Inventory Id) here is different from the object that is lying on the ground and represents this item in the map (Pickup id). If you want to listen to every item pickup use ItemPickedUp message! Corresponding GameBots message is AIN.

Parameters:
Id - A unique Id for this inventory item, assigned by the game. Unique, but based on a string describing the item type.
Type - A string representing type (inventory type) of the object.
Descriptor - Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
PickupType - We get this item if we pick up this pickup class in the map.
Sniping - If the item is a weapon, contains information whether this weapon is good for sniping.
Melee - If the item is a weapon, contains information whether this weapon is a melee weapon.
PrimaryInitialAmmo - If the item is a weapon, contains information how much primary ammo the weapon initial has.
MaxPrimaryAmmo - If the item is a weapon, contains information how much primary ammo the weapon may have.
SecondaryInitialAmmo - If the item is a weapon, contains information how much secondary ammo the weapon initial has.
MaxSecondaryAmmo - If the item is a weapon, contains information how much secondary ammo the weapon may have.

AddInventoryMsg

public AddInventoryMsg(AddInventoryMsg 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()
A unique Id for this inventory item, assigned by the game. Unique, but based on a string describing the item type.


getType

public java.lang.String getType()
A string representing type (inventory type) of the object.


getDescriptor

public ItemDescriptor getDescriptor()
Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.


getPickupType

public ItemType getPickupType()
We get this item if we pick up this pickup class in the map.


isSniping

public java.lang.Boolean isSniping()
If the item is a weapon, contains information whether this weapon is good for sniping.


isMelee

public java.lang.Boolean isMelee()
If the item is a weapon, contains information whether this weapon is a melee weapon.


getPrimaryInitialAmmo

public int getPrimaryInitialAmmo()
If the item is a weapon, contains information how much primary ammo the weapon initial has.


getMaxPrimaryAmmo

public int getMaxPrimaryAmmo()
If the item is a weapon, contains information how much primary ammo the weapon may have.


getSecondaryInitialAmmo

public int getSecondaryInitialAmmo()
If the item is a weapon, contains information how much secondary ammo the weapon initial has.


getMaxSecondaryAmmo

public int getMaxSecondaryAmmo()
If the item is a weapon, contains information how much secondary ammo the weapon may have.


toString

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

toHtmlString

public java.lang.String toHtmlString()