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

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

public class ItemPickedUp
extends InfoMessage
implements IWorldEvent, IWorldChangeEvent, ILocated

Definition of the event IPK.

Complete message documentation: Asynchronous message. Comes when we have picked up an item. This does not mean the item will be added to our inventory (for example Adrenaline or Health pickup just raise our stats).


Field Summary
protected  int Amount
          If this item is some ammo or health pack, here we can find out how much of the attribute this item will add.
protected  int AmountSec
          Only sent if this item is a weapon.
protected  ItemDescriptor Descriptor
          Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
protected  java.lang.Boolean Dropped
          Whether it is a regular item or dropped by player or bot.
protected  UnrealId Id
          Unique Id of the item.
protected  UnrealId InventoryId
          Unique Id of the item in our inventory - use this Id to do changeweapons etc.
protected  Location Location
          Location of the item.
static java.lang.String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  long SimTime
           
protected  ItemType Type
          Class of the item (e.g.
 
Constructor Summary
ItemPickedUp()
          Parameter-less contructor for the message.
ItemPickedUp(ItemPickedUp original)
          Cloning constructor from the full message.
ItemPickedUp(UnrealId Id, UnrealId InventoryId, Location Location, int Amount, int AmountSec, ItemType Type, ItemDescriptor Descriptor, java.lang.Boolean Dropped)
          Creates new instance of the message ItemPickedUp.
 
Method Summary
 int getAmount()
          If this item is some ammo or health pack, here we can find out how much of the attribute this item will add.
 int getAmountSec()
          Only sent if this item is a weapon.
 ItemDescriptor getDescriptor()
          Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
 UnrealId getId()
          Unique Id of the item.
 UnrealId getInventoryId()
          Unique Id of the item in our inventory - use this Id to do changeweapons etc.
 Location getLocation()
          Location of the item.
 long getSimTime()
          Returns the simulation time when the event has occurred.
 ItemType getType()
          Class of the item (e.g.
 java.lang.Boolean isDropped()
          Whether it is a regular item or dropped by player or bot.
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 item. This Id represents just item on the map, not in our inventory.


InventoryId

protected UnrealId InventoryId
Unique Id of the item in our inventory - use this Id to do changeweapons etc. Unreal has different Ids for items in map and actual item in bot's inventory. If the item does not go into our inventory nothing will be here (null).


Location

protected Location Location
Location of the item.


Amount

protected int Amount
If this item is some ammo or health pack, here we can find out how much of the attribute this item will add. Works also for weapons - will hold primary ammo amount.


AmountSec

protected int AmountSec
Only sent if this item is a weapon. Holds secondary ammo amount.


Type

protected ItemType Type
Class of the item (e.g. xWeapons.FlakCannonPickup).


Descriptor

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


Dropped

protected java.lang.Boolean Dropped
Whether it is a regular item or dropped by player or bot.

Constructor Detail

ItemPickedUp

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


ItemPickedUp

public ItemPickedUp(UnrealId Id,
                    UnrealId InventoryId,
                    Location Location,
                    int Amount,
                    int AmountSec,
                    ItemType Type,
                    ItemDescriptor Descriptor,
                    java.lang.Boolean Dropped)
Creates new instance of the message ItemPickedUp. Asynchronous message. Comes when we have picked up an item. This does not mean the item will be added to our inventory (for example Adrenaline or Health pickup just raise our stats). Corresponding GameBots message is IPK.

Parameters:
Id - Unique Id of the item. This Id represents just item on the map, not in our inventory.
InventoryId - Unique Id of the item in our inventory - use this Id to do changeweapons etc. Unreal has different Ids for items in map and actual item in bot's inventory. If the item does not go into our inventory nothing will be here (null).
Location - Location of the item.
Amount - If this item is some ammo or health pack, here we can find out how much of the attribute this item will add. Works also for weapons - will hold primary ammo amount.
AmountSec - Only sent if this item is a weapon. Holds secondary ammo amount.
Type - Class of the item (e.g. xWeapons.FlakCannonPickup).
Descriptor - Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
Dropped - Whether it is a regular item or dropped by player or bot.

ItemPickedUp

public ItemPickedUp(ItemPickedUp 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 item. This Id represents just item on the map, not in our inventory.


getInventoryId

public UnrealId getInventoryId()
Unique Id of the item in our inventory - use this Id to do changeweapons etc. Unreal has different Ids for items in map and actual item in bot's inventory. If the item does not go into our inventory nothing will be here (null).


getLocation

public Location getLocation()
Location of the item.

Specified by:
getLocation in interface ILocated
Returns:
Current location of the object, represented as a point within the world's coordinates.

getAmount

public int getAmount()
If this item is some ammo or health pack, here we can find out how much of the attribute this item will add. Works also for weapons - will hold primary ammo amount.


getAmountSec

public int getAmountSec()
Only sent if this item is a weapon. Holds secondary ammo amount.


getType

public ItemType getType()
Class of the item (e.g. xWeapons.FlakCannonPickup).


getDescriptor

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


isDropped

public java.lang.Boolean isDropped()
Whether it is a regular item or dropped by player or bot.


toString

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

toHtmlString

public java.lang.String toHtmlString()