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

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Item
All Implemented Interfaces:
IWorldChangeEvent, IWorldEvent, IWorldObject, ILocated, IViewable, ICompositeWorldObject, ItemTyped, IGBViewable, Event
Direct Known Subclasses:
ItemCompositeImpl, ItemMessage

public abstract class Item
extends InfoMessage
implements IWorldEvent, IWorldChangeEvent, ICompositeWorldObject, ILocated, IGBViewable, ItemTyped

Abstract definition of the GameBots2004 message INV.

Complete message documentation: Synchronous/asynchronous message. An object on the ground that can be picked up.


Nested Class Summary
static class Item.ItemUpdate
           
static class Item.ObjectDisappeared
           
 
Field Summary
static java.lang.String PROTOTYPE
          Example how the message looks like - used during parser tests.
protected  long SimTime
           
 
Constructor Summary
Item()
          Parameter-less contructor for the message.
 
Method Summary
 IWorldObjectUpdatedEvent createDisappearEvent()
          Creates an update event that has to update visibility to false.
abstract  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.
abstract  ItemDescriptor getDescriptor()
          Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
abstract  UnrealId getId()
          Unique Id of the item.
abstract  Location getLocation()
          Location of the item.
abstract  NavPoint getNavPoint()
          If the Item is not dropped then it's item that is laying at some navpoint and this is that NavPoint instance.
abstract  UnrealId getNavPointId()
          Id of the navpoint where the item is laying.
 long getSimTime()
          Returns the simulation time when the event has occurred.
abstract  ItemType getType()
          Class of the item (e.g.
abstract  boolean isDropped()
          Whether it is regular item or one dropped by some bot (usually during dying).
abstract  boolean isReachable()
          True if agent can reach the item.
abstract  boolean isVisible()
          If the item is in the field of view of the 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
 
Methods inherited from interface cz.cuni.amis.pogamut.multi.communication.worldview.object.ICompositeWorldObject
getLocal, getShared, getStatic
 

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
Constructor Detail

Item

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

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
Specified by:
getSimTime in interface IWorldObject
Returns:
timestamp

setSimTime

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


getId

public abstract UnrealId getId()
Unique Id of the item. This Id represents just item on the map, not in our inventory.

Specified by:
getId in interface IWorldObject
Returns:

getNavPointId

public abstract UnrealId getNavPointId()
Id of the navpoint where the item is laying. If null - the item was dropped by the bot or another player.


getNavPoint

public abstract NavPoint getNavPoint()
If the Item is not dropped then it's item that is laying at some navpoint and this is that NavPoint instance.


isVisible

public abstract boolean isVisible()
If the item is in the field of view of the bot.

Specified by:
isVisible in interface IViewable
Returns:
True if the object is visible; false otherwise.

getLocation

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

isReachable

public abstract boolean isReachable()
True if agent can reach the item.


getAmount

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


getType

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

Specified by:
getType in interface ItemTyped
Returns:

getDescriptor

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


isDropped

public abstract boolean isDropped()
Whether it is regular item or one dropped by some bot (usually during dying). Items that are not dropped usually respawns itself (depends on the game settings) while those that are dropped may be taken only once.


createDisappearEvent

public IWorldObjectUpdatedEvent createDisappearEvent()
Description copied from interface: IGBViewable
Creates an update event that has to update visibility to false.

Specified by:
createDisappearEvent in interface IGBViewable
Returns:

toString

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

toHtmlString

public java.lang.String toHtmlString()