|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.base.communication.messages.InfoMessage
cz.cuni.amis.pogamut.udk.communication.messages.GBObjectUpdate
cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.Item
public class Item
Synchronous/asynchronous message. An object on the ground that can be picked up. Corresponding GameBots message is INV.
| Nested Class Summary | |
|---|---|
static class |
Item.ObjectDisappeared
Used to drop Visible flag from the object. |
| 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 some ammo or health pack, here we can find out how much of the attribute this item will add. |
protected ItemDescriptor |
Descriptor
Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor. |
protected boolean |
Dropped
Whether it is regular item or one dropped by some bot (usually during dying). |
protected UnrealId |
Id
Unique Id of the item. |
protected Location |
Location
Location of the item. |
protected NavPoint |
NavPoint
If the Item is not dropped then it's item that is laying at some navpoint and this is that NavPoint instance. |
protected UnrealId |
NavPointId
Id of the navpoint where the item is laying. |
static String |
PROTOTYPE
Example how the message looks like - used during parser tests. |
protected boolean |
Reachable
True if agent can reach the item. |
protected double |
Time
|
protected ItemType |
Type
Class of the item (e.g. |
protected boolean |
Visible
If the item is in the field of view of the bot. |
| Constructor Summary | |
|---|---|
Item()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package). |
|
Item(Item original)
Cloning constructor. |
|
Item(Item Original,
boolean Visible)
Used to create event that drops the Visible flag of the item. |
|
Item(UnrealId Id,
UnrealId NavPointId,
NavPoint NavPoint,
boolean Visible,
Location Location,
boolean Reachable,
int Amount,
ItemType Type,
ItemDescriptor Descriptor,
boolean Dropped)
Creates new instance of command Item. |
|
| Method Summary | |
|---|---|
IGBWorldObjectDisappeared |
createDisappearEvent()
Creates an update event that has to update visibility to false. |
boolean |
equals(Object obj)
|
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. |
double |
getLastSeenTime()
|
ILocalWorldObject |
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. |
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()
|
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 |
setNavPoint(NavPoint navPoint)
DO NOT USE THIS METHOD! Reserved for GaviaLib (Pogamut core)! It's used to set correct navpoint instance into the item. |
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 |
|---|
public static final String PROTOTYPE
protected UnrealId Id
protected UnrealId NavPointId
protected NavPoint NavPoint
protected boolean Visible
protected Location Location
protected boolean Reachable
protected int Amount
protected ItemType Type
protected ItemDescriptor Descriptor
protected boolean Dropped
protected double Time
| Constructor Detail |
|---|
public Item(UnrealId Id,
UnrealId NavPointId,
NavPoint NavPoint,
boolean Visible,
Location Location,
boolean Reachable,
int Amount,
ItemType Type,
ItemDescriptor Descriptor,
boolean Dropped)
Id - Unique Id of the item. This Id represents just item on the
map, not in our inventory.NavPointId - Id of the navpoint where the item is laying. If null - the item was dropped by the bot or another player.NavPoint - If the Item is not dropped then it's item that is laying at some navpoint and
this is that NavPoint instance.Visible - If the item is in the field of view of the bot.Location - Location of the item.Reachable - True if agent can reach 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.Type - Class of the item (e.g. xWeapons.FlakCannonPickup).Descriptor - Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.Dropped - 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.public Item(Item original)
public Item()
public Item(Item Original,
boolean Visible)
| Method Detail |
|---|
public UnrealId getId()
getId in interface IWorldObjectUpdatedEventgetId in interface IWorldObjectpublic UnrealId getNavPointId()
public NavPoint getNavPoint()
public boolean isVisible()
isVisible in interface IViewablepublic Location getLocation()
getLocation in interface ILocatedpublic boolean isReachable()
public int getAmount()
public ItemType getType()
getType in interface ItemTypedpublic ItemDescriptor getDescriptor()
public boolean isDropped()
protected double getTime()
protected void setTime(double time)
public double getLastSeenTime()
public ILocalWorldObject getLocal()
getLocal in interface ICompositeWorldObjectpublic ISharedWorldObject getShared()
getShared in interface ICompositeWorldObjectpublic IStaticWorldObject getStatic()
getStatic in interface ICompositeWorldObjectpublic long getSimTime()
getSimTime in interface IWorldChangeEventgetSimTime in interface IWorldObjectpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic void setNavPoint(NavPoint navPoint)
public IGBWorldObjectDisappeared createDisappearEvent()
IGBViewable
createDisappearEvent in interface IGBViewablepublic IWorldObjectUpdateResult update(IWorldObject obj)
update in interface IWorldObjectUpdatedEventpublic IWorldObject getObject()
public String toString()
toString in class InfoMessagepublic String toHtmlString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||