public class Item extends GBObjectUpdate implements IGBWorldObjectEvent, IWorldObject, ILocated, IGBViewable, ItemTyped
| Modifier and Type | Class and Description |
|---|---|
static class |
Item.ObjectDisappeared
Used to drop Visible flag from the object.
|
IWorldObjectUpdatedEvent.DestroyWorldObject| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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) |
toJsonLiteralpublic 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
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)
public UnrealId getId()
getId in interface IWorldObjectUpdatedEventgetId in interface IWorldObjectpublic UnrealId getNavPointId()
public NavPoint getNavPoint()
public boolean isVisible()
public Location getLocation()
getLocation in interface ILocatedpublic boolean isReachable()
public int getAmount()
public ItemType getType()
public 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 void setNavPoint(NavPoint navPoint)
public IGBWorldObjectDisappeared createDisappearEvent()
IGBViewablecreateDisappearEvent in interface IGBViewablepublic IWorldObjectUpdateResult update(IWorldObject obj)
update in interface IWorldObjectUpdatedEventpublic IWorldObject getObject()
public String toString()
toString in class InfoMessagepublic String toHtmlString()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.