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

Package class diagram package MyInventory
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.udk.communication.messages.GBObjectUpdate
          extended by cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.MyInventory
All Implemented Interfaces:
IWorldChangeEvent, IWorldObjectUpdatedEvent, IWorldObject, IGBWorldObjectEvent, cz.cuni.amis.utils.listener.Event

public class MyInventory
extends GBObjectUpdate
implements IGBWorldObjectEvent, IWorldObject

An object in the observed player's inventory. Corresponding GameBots message is MYINV.


Nested Class Summary
 
Nested classes/interfaces inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent
IWorldObjectUpdatedEvent.DestroyWorldObject
 
Field Summary
protected  int Amount
          If this item is ammo or armor, this holds the amount of the item the player has.
protected  int CurrentAltAmmo
          If this item is a weapon, this holds the amount of secondary ammo.
protected  int CurrentAmmo
          If this item is a weapon, this holds the amount of primary ammo.
protected  ItemDescriptor Descriptor
          Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
protected  UnrealId Id
          Unique Id of the item.
static String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  double Time
           
protected  ItemType Type
          Class of the item (e.g.
 
Constructor Summary
MyInventory()
          Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
MyInventory(MyInventory original)
          Cloning constructor.
MyInventory(UnrealId Id, int CurrentAmmo, int CurrentAltAmmo, int Amount, ItemType Type, ItemDescriptor Descriptor)
          Creates new instance of command MyInventory.
 
Method Summary
 boolean equals(Object obj)
           
 int getAmount()
          If this item is ammo or armor, this holds the amount of the item the player has.
 int getCurrentAltAmmo()
          If this item is a weapon, this holds the amount of secondary ammo.
 int getCurrentAmmo()
          If this item is a weapon, this holds the amount of primary ammo.
 ItemDescriptor getDescriptor()
          Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
 UnrealId getId()
          Unique Id of the item.
 double getLastSeenTime()
           
 ILocalWorldObject getLocal()
           
 IWorldObject getObject()
          Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).
 ISharedWorldObject getShared()
           
 long getSimTime()
           
 IStaticWorldObject getStatic()
           
protected  double getTime()
           
 ItemType getType()
          Class of the item (e.g.
 int hashCode()
           
protected  void setTime(double time)
           
 String toHtmlString()
           
 String toString()
           
 IWorldObjectUpdateResult update(IWorldObject obj)
           
 
Methods inherited from class cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
toJsonLiteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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
Unique Id of the item. This Id represents the item in the inventory.


CurrentAmmo

protected int CurrentAmmo
If this item is a weapon, this holds the amount of primary ammo.


CurrentAltAmmo

protected int CurrentAltAmmo
If this item is a weapon, this holds the amount of secondary ammo.


Amount

protected int Amount
If this item is ammo or armor, this holds the amount of the item the player has.


Type

protected ItemType Type
Class of the item (e.g. LinkGun.WeaponPickup).


Descriptor

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


Time

protected double Time
Constructor Detail

MyInventory

public MyInventory(UnrealId Id,
                   int CurrentAmmo,
                   int CurrentAltAmmo,
                   int Amount,
                   ItemType Type,
                   ItemDescriptor Descriptor)
Creates new instance of command MyInventory. An object in the observed player's inventory. Corresponding GameBots message for this command is .

Parameters:
Id - Unique Id of the item. This Id represents the item in the inventory.
CurrentAmmo - If this item is a weapon, this holds the amount of primary ammo.
CurrentAltAmmo - If this item is a weapon, this holds the amount of secondary ammo.
Amount - If this item is ammo or armor, this holds the amount of the item the player has.
Type - Class of the item (e.g. LinkGun.WeaponPickup).
Descriptor - Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.

MyInventory

public MyInventory(MyInventory original)
Cloning constructor.


MyInventory

public MyInventory()
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()
Unique Id of the item. This Id represents the item in the inventory.

Specified by:
getId in interface IWorldObjectUpdatedEvent
Specified by:
getId in interface IWorldObject

getCurrentAmmo

public int getCurrentAmmo()
If this item is a weapon, this holds the amount of primary ammo.


getCurrentAltAmmo

public int getCurrentAltAmmo()
If this item is a weapon, this holds the amount of secondary ammo.


getAmount

public int getAmount()
If this item is ammo or armor, this holds the amount of the item the player has.


getType

public ItemType getType()
Class of the item (e.g. LinkGun.WeaponPickup).


getDescriptor

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


getTime

protected double getTime()

setTime

protected void setTime(double time)

getLastSeenTime

public double getLastSeenTime()

getLocal

public ILocalWorldObject getLocal()

getShared

public ISharedWorldObject getShared()

getStatic

public IStaticWorldObject getStatic()

getSimTime

public long getSimTime()
Specified by:
getSimTime in interface IWorldChangeEvent
Specified by:
getSimTime in interface IWorldObject

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

update

public IWorldObjectUpdateResult update(IWorldObject obj)
Specified by:
update in interface IWorldObjectUpdatedEvent

getObject

public IWorldObject getObject()
Returns original object (if method update() has already been called, for bot-programmer that is always true as the original object is updated and then the event is propagated).


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.