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

Package class diagram package ItemReceived
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ItemReceived
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent, cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent, cz.cuni.amis.utils.listener.Event

public class ItemReceived
extends cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
implements cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent, cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent

Definition of the event IRC.

Complete message documentation: Asynchronous message. Other bot gave us an item. We receive normal IPK message and this message with information about the giver and the item.


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  Boolean Dropped
          Whether it is a regular item or dropped by player or bot.
protected  cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId GiverId
          Unique Id of the bot that gave us this item.
protected  cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Id
          Unique Id of the item.
protected  cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId InventoryId
          Unique Id of the item in our inventory - use this Id to do changeweapons etc.
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Location Location
          Location of the item.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  long SimTime
           
protected  String Type
          Class of the item.
 
Constructor Summary
ItemReceived()
          Parameter-less contructor for the message.
ItemReceived(ItemReceived original)
          Cloning constructor from the full message.
ItemReceived(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Id, cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId InventoryId, cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId GiverId, cz.cuni.amis.pogamut.base3d.worldview.object.Location Location, int Amount, String Type, Boolean Dropped)
          Creates new instance of the message ItemReceived.
 
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.
 cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getGiverId()
          Unique Id of the bot that gave us this item.
 cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getId()
          Unique Id of the item.
 cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getInventoryId()
          Unique Id of the item in our inventory - use this Id to do changeweapons etc.
 cz.cuni.amis.pogamut.base3d.worldview.object.Location getLocation()
          Location of the item.
 long getSimTime()
          Simulation time in MILLI SECONDS !!!
 String getType()
          Class of the item.
 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.
 String toHtmlString()
           
 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 String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

SimTime

protected long SimTime

Id

protected cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Id
Unique Id of the item. This Id represents just item on the map, not in our inventory.


InventoryId

protected cz.cuni.amis.pogamut.unreal.communication.messages.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).


GiverId

protected cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId GiverId
Unique Id of the bot that gave us this item.


Location

protected cz.cuni.amis.pogamut.base3d.worldview.object.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.


Type

protected String Type
Class of the item.


Dropped

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

Constructor Detail

ItemReceived

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


ItemReceived

public ItemReceived(cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId Id,
                    cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId InventoryId,
                    cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId GiverId,
                    cz.cuni.amis.pogamut.base3d.worldview.object.Location Location,
                    int Amount,
                    String Type,
                    Boolean Dropped)
Creates new instance of the message ItemReceived. Asynchronous message. Other bot gave us an item. We receive normal IPK message and this message with information about the giver and the item. Corresponding GameBots message is IRC.

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).
GiverId - Unique Id of the bot that gave us this item.
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.
Type - Class of the item.
Dropped - Whether it is a regular item or dropped by player or bot.

ItemReceived

public ItemReceived(ItemReceived original)
Cloning constructor from the full message.

Parameters:
original -
Method Detail

getSimTime

public long getSimTime()
Simulation time in MILLI SECONDS !!!

Specified by:
getSimTime in interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent
Specified by:
getSimTime in interface cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEvent

setSimTime

protected void setSimTime(long SimTime)
Used by Yylex to slip correct time of the object or programmatically.


getId

public cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getId()
Unique Id of the item. This Id represents just item on the map, not in our inventory.


getInventoryId

public cz.cuni.amis.pogamut.unreal.communication.messages.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).


getGiverId

public cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId getGiverId()
Unique Id of the bot that gave us this item.


getLocation

public cz.cuni.amis.pogamut.base3d.worldview.object.Location getLocation()
Location of the item.


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.


getType

public String getType()
Class of the item.


isDropped

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


toString

public String toString()
Overrides:
toString in class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage

toHtmlString

public String toHtmlString()


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