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

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

public class ItemCompositeImpl
extends Item

Composite implementation of the INV abstract message. It wraps Local/Shared/Static parts in single object allowing to presenting a nice facade for users.

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


Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Item
Item.ItemUpdate, Item.ObjectDisappeared
 
Field Summary
protected  ItemLocalImpl partLocal
           
protected  ItemStaticImpl partStatic
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Item
PROTOTYPE, SimTime
 
Constructor Summary
ItemCompositeImpl()
          Parameter-less contructor for the message.
ItemCompositeImpl(ItemCompositeImpl original)
          Cloning constructor.
ItemCompositeImpl(ItemLocalImpl partLocal, ItemSharedImpl partShared, ItemStaticImpl partStatic)
          Composite-impl constructor.
 
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.
 ItemDescriptor getDescriptor()
          Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
 UnrealId getId()
          Unique Id of the item.
 ItemLocal getLocal()
           
 Location getLocation()
          Location of the item.
 NavPoint getNavPoint()
          If the Item is not dropped then it's item that is laying at some navpoint and this is that NavPoint instance.
 UnrealId getNavPointId()
          Id of the navpoint where the item is laying.
 ItemShared getShared()
           
 ItemStatic getStatic()
           
 ItemType getType()
          Class of the item (e.g.
 boolean isDropped()
          Whether it is regular item or one dropped by some bot (usually during dying).
 boolean isReachable()
          True if agent can reach the item.
 boolean isVisible()
          If the item is in the field of view of the bot.
 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 cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Item
createDisappearEvent, getSimTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

partStatic

protected ItemStaticImpl partStatic

partLocal

protected ItemLocalImpl partLocal
Constructor Detail

ItemCompositeImpl

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


ItemCompositeImpl

public ItemCompositeImpl(ItemLocalImpl partLocal,
                         ItemSharedImpl partShared,
                         ItemStaticImpl partStatic)
Composite-impl constructor. It assembles the message from its three fragments - local/shared/static.

Parameters:
partLocal - local-part of the message
partShared - shared-part of the message
partStatic - static-part of the message

ItemCompositeImpl

public ItemCompositeImpl(ItemCompositeImpl original)
Cloning constructor.

Parameters:
original -
Method Detail

setSimTime

public void setSimTime(long SimTime)
Description copied from class: Item
Used by Yylex to slip correct time of the object or programmatically.

Overrides:
setSimTime in class Item

getStatic

public ItemStatic getStatic()

getLocal

public ItemLocal getLocal()

getShared

public ItemShared getShared()

getId

public UnrealId getId()
Description copied from class: Item
Unique Id of the item. This Id represents just item on the map, not in our inventory.

Specified by:
getId in interface IWorldObject
Specified by:
getId in class Item
Returns:

getNavPointId

public UnrealId getNavPointId()
Description copied from class: Item
Id of the navpoint where the item is laying. If null - the item was dropped by the bot or another player.

Specified by:
getNavPointId in class Item

getNavPoint

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

Specified by:
getNavPoint in class Item

isVisible

public boolean isVisible()
Description copied from class: Item
If the item is in the field of view of the bot.

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

getLocation

public Location getLocation()
Description copied from class: Item
Location of the item.

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

isReachable

public boolean isReachable()
Description copied from class: Item
True if agent can reach the item.

Specified by:
isReachable in class Item

getAmount

public int getAmount()
Description copied from class: Item
If this item is some ammo or health pack, here we can find out how much of the attribute this item will add.

Specified by:
getAmount in class Item

getType

public ItemType getType()
Description copied from class: Item
Class of the item (e.g. xWeapons.FlakCannonPickup).

Specified by:
getType in interface ItemTyped
Specified by:
getType in class Item
Returns:

getDescriptor

public ItemDescriptor getDescriptor()
Description copied from class: Item
Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.

Specified by:
getDescriptor in class Item

isDropped

public boolean isDropped()
Description copied from class: Item
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.

Specified by:
isDropped in class Item

toString

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

toHtmlString

public java.lang.String toHtmlString()
Overrides:
toHtmlString in class Item