|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.udk.agent.module.sensomotoric.Weapon
public class Weapon
Class that holds information about the weapon the bot has in its inventory.
It provides information about number of primary and secondary ammo the bot has for the weapon
as well as weapon's WeaponDescriptor
, its ItemType
and inventory UnrealId
.
Field Summary | |
---|---|
protected WeaponDescriptor |
descriptor
|
protected UnrealId |
inventoryId
|
protected int |
primaryAmmo
|
protected int |
secondaryAmmo
|
protected ItemType |
weaponType
|
Constructor Summary | |
---|---|
protected |
Weapon(AddInventoryMsg weaponGained,
int primaryAmmo,
int secondaryAmmo)
|
Method Summary | |
---|---|
int |
getAmmo()
Returns total ammount of ammo the bot has for the weapon (both primary and secondary). |
WeaponDescriptor |
getDescriptor()
Returns complete descriptor of the weapon containing various information about the weapon behavior in game. |
ItemType.Group |
getGroup()
Returns group of the weapon. |
UnrealId |
getInventoryId()
Returns inventory ID of the weapon. |
int |
getPrimaryAmmo()
Returns how many primary ammo the bot is wielding for this weapon. |
int |
getSecondaryAmmo()
Returns how many secondary ammo the bot is wielding for this weapon. |
ItemType |
getType()
Returns type of the weapon. |
boolean |
hasSecondaryAmmoType()
Whether the weapon has secondary ammo different from the primary. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ItemType weaponType
protected int primaryAmmo
protected int secondaryAmmo
protected UnrealId inventoryId
protected WeaponDescriptor descriptor
Constructor Detail |
---|
protected Weapon(AddInventoryMsg weaponGained, int primaryAmmo, int secondaryAmmo)
Method Detail |
---|
public ItemType getType()
public ItemType.Group getGroup()
public int getPrimaryAmmo()
public int getSecondaryAmmo()
public UnrealId getInventoryId()
This id is sought to be used with ChangeWeapon
command, use WorldObjectId.getStringId()
to obtain
the string representation of the weapon's inventory ID.
public WeaponDescriptor getDescriptor()
public boolean hasSecondaryAmmoType()
public int getAmmo()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |