public class Weapon extends Object
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.
| Modifier and Type | Field and Description |
|---|---|
protected WeaponDescriptor |
descriptor |
protected UnrealId |
inventoryId |
protected int |
primaryAmmo |
protected int |
secondaryAmmo |
protected ItemType |
weaponType |
| Modifier | Constructor and Description |
|---|---|
protected |
Weapon(AddInventoryMsg weaponGained,
int primaryAmmo,
int secondaryAmmo) |
| Modifier and Type | Method and Description |
|---|---|
int |
getAmmo()
Returns total amount 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() |
protected ItemType weaponType
protected int primaryAmmo
protected int secondaryAmmo
protected UnrealId inventoryId
protected WeaponDescriptor descriptor
protected Weapon(AddInventoryMsg weaponGained, int primaryAmmo, int secondaryAmmo)
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()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.