public class MyInventory extends GBObjectUpdate implements IGBWorldObjectEvent, IWorldObject
IWorldObjectUpdatedEvent.DestroyWorldObject| Modifier and Type | Field and Description |
|---|---|
protected int |
Amount
If this item is ammo or armor, this holds the amount of the item the player has.
|
protected int |
CurrentAltAmmo
If this item is a weapon, this holds the amount of secondary ammo.
|
protected int |
CurrentAmmo
If this item is a weapon, this holds the amount of primary ammo.
|
protected ItemDescriptor |
Descriptor
Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.
|
protected UnrealId |
Id
Unique Id of the item.
|
static String |
PROTOTYPE
Example how the message looks like - used during parser tests.
|
protected double |
Time |
protected ItemType |
Type
Class of the item (e.g.
|
| Constructor and Description |
|---|
MyInventory()
Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
|
MyInventory(MyInventory original)
Cloning constructor.
|
MyInventory(UnrealId Id,
int CurrentAmmo,
int CurrentAltAmmo,
int Amount,
ItemType Type,
ItemDescriptor Descriptor)
Creates new instance of command MyInventory.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
getAmount()
If this item is ammo or armor, this holds the amount of the item the player has.
|
int |
getCurrentAltAmmo()
If this item is a weapon, this holds the amount of secondary ammo.
|
int |
getCurrentAmmo()
If this item is a weapon, this holds the amount of primary ammo.
|
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() |
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() |
protected void |
setTime(double time) |
String |
toHtmlString() |
String |
toString() |
IWorldObjectUpdateResult |
update(IWorldObject obj) |
toJsonLiteralpublic static final String PROTOTYPE
protected UnrealId Id
protected int CurrentAmmo
protected int CurrentAltAmmo
protected int Amount
protected ItemType Type
protected ItemDescriptor Descriptor
protected double Time
public MyInventory(UnrealId Id, int CurrentAmmo, int CurrentAltAmmo, int Amount, ItemType Type, ItemDescriptor Descriptor)
Id - Unique Id of the item. This Id represents the item in the inventory.CurrentAmmo - If this item is a weapon, this holds the amount of primary ammo.CurrentAltAmmo - If this item is a weapon, this holds the amount of secondary ammo.Amount - If this item is ammo or armor, this holds the amount of the item the player has.Type - Class of the item (e.g. LinkGun.WeaponPickup).Descriptor - Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor.public MyInventory(MyInventory original)
public MyInventory()
public UnrealId getId()
getId in interface IWorldObjectUpdatedEventgetId in interface IWorldObjectpublic int getCurrentAmmo()
public int getCurrentAltAmmo()
public int getAmount()
public ItemType getType()
public ItemDescriptor getDescriptor()
protected double getTime()
protected void setTime(double time)
public double getLastSeenTime()
public ILocalWorldObject getLocal()
public ISharedWorldObject getShared()
public IStaticWorldObject getStatic()
public long getSimTime()
getSimTime in interface IWorldChangeEventgetSimTime in interface IWorldObjectpublic 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.