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:
IWorldChangeEvent, IWorldEvent, cz.cuni.amis.utils.listener.Event

public class ItemReceived
extends InfoMessage
implements IWorldEvent, 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  UnrealId GiverId
          Unique Id of the bot that gave us this item.
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 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(UnrealId Id, UnrealId InventoryId, UnrealId GiverId, 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.
 UnrealId getGiverId()
          Unique Id of the bot that gave us this item.
 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()
          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 toJsonLiteral()
           
 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 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).


GiverId

protected UnrealId GiverId
Unique Id of the bot that gave us this item.


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.


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(UnrealId Id,
                    UnrealId InventoryId,
                    UnrealId GiverId,
                    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 IWorldChangeEvent
Specified by:
getSimTime in interface IWorldEvent

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


getGiverId

public UnrealId getGiverId()
Unique Id of the bot that gave us this item.


getLocation

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

toHtmlString

public String toHtmlString()

toJsonLiteral

public String toJsonLiteral()
Overrides:
toJsonLiteral in class InfoMessage


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