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

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

public class AddInventoryMsg
extends GBEvent
implements IWorldEvent, IWorldChangeEvent

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.


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  ItemType PickupType
          We get this item if we pick up this pickup class in the map.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  String Type
          A string representing type (inventory type) of the object.
 
Constructor Summary
AddInventoryMsg()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
AddInventoryMsg(AddInventoryMsg original)
          Cloning constructor.
AddInventoryMsg(UnrealId Id, String Type, ItemDescriptor Descriptor, ItemType PickupType)
          Creates new instance of command 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.
 ItemType getPickupType()
          We get this item if we pick up this pickup class in the map.
 long getSimTime()
           
 String getType()
          A string representing type (inventory type) of the object.
 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
A unique Id for this inventory item, assigned by the game. Unique, but based on a string describing the item type.


Type

protected 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.

Constructor Detail

AddInventoryMsg

public AddInventoryMsg(UnrealId Id,
                       String Type,
                       ItemDescriptor Descriptor,
                       ItemType PickupType)
Creates new instance of command 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 for this command is .

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.

AddInventoryMsg

public AddInventoryMsg(AddInventoryMsg original)
Cloning constructor.


AddInventoryMsg

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


getType

public 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.


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.