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

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.InfoMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ItemShared
          extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ItemSharedImpl
All Implemented Interfaces:
IWorldObject, ILocated, ISharedWorldObject, java.lang.Cloneable

public class ItemSharedImpl
extends ItemShared

Implementation of the shared part 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 ItemSharedImpl.ItemSharedUpdate
           
 
Field Summary
protected  UnrealId Id
          Unique Id of the item.
protected  BooleanProperty myDropped
          Whether it is regular item or one dropped by some bot (usually during dying).
protected  LocationProperty myLocation
          Location of the item.
protected  java.util.HashMap<PropertyId,ISharedProperty> propertyMap
           
 
Fields inherited from class cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ItemShared
DroppedPropertyToken, LocationPropertyToken, SharedPropertyTokens, SimTime
 
Constructor Summary
ItemSharedImpl(ItemSharedImpl source)
           
ItemSharedImpl(WorldObjectId objectId, java.util.Collection<ISharedProperty> properties)
           
 
Method Summary
 ItemSharedImpl clone()
           
 UnrealId getId()
          Unique Id of the item.
 Location getLocation()
          Location of the item.
 java.util.Map<PropertyId,ISharedProperty> getProperties()
           
 ISharedProperty getProperty(PropertyId id)
           
 boolean isDropped()
          Whether it is regular item or one dropped by some bot (usually during dying).
 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.ItemShared
getCompositeClass, getSimTime
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

propertyMap

protected java.util.HashMap<PropertyId,ISharedProperty> propertyMap

Id

protected UnrealId Id
Unique Id of the item. This Id represents just item on the map, not in our inventory.


myLocation

protected LocationProperty myLocation
Location of the item.


myDropped

protected BooleanProperty myDropped
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.

Constructor Detail

ItemSharedImpl

public ItemSharedImpl(ItemSharedImpl source)

ItemSharedImpl

public ItemSharedImpl(WorldObjectId objectId,
                      java.util.Collection<ISharedProperty> properties)
Method Detail

setSimTime

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

Overrides:
setSimTime in class ItemShared

clone

public ItemSharedImpl clone()
Specified by:
clone in interface ISharedWorldObject
Specified by:
clone in class ItemShared

getProperty

public ISharedProperty getProperty(PropertyId id)

getProperties

public java.util.Map<PropertyId,ISharedProperty> getProperties()

getId

public 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
Specified by:
getId in class ItemShared
Returns:

getLocation

public Location getLocation()
Location of the item.

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

isDropped

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

Specified by:
isDropped in class ItemShared

toString

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

toHtmlString

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