cz.cuni.pogamut.Client
Interface Inventory

All Known Implementing Classes:
AgentMemory

public interface Inventory

Inventory specifies methods that should provide easy and fast work with agent inventory


Method Summary
 java.util.ArrayList<AddWeapon> getAllWeapons()
          obtain a pointer on the structure in which inventory stores items
 AddWeapon getAnyWeapon()
          get any loaded weapon from directory
 AddWeapon getBetterWeapon(Triple from, Triple to)
          Search inventory for better weapon - this is done according to distance between triples supplied as parameters.
 java.util.ArrayList<AddWeapon> getCopyOfAllWeapons()
          obtain a copy of the structure in which inventory stores items
 AddWeapon getMeleeWeapon()
          get any melee loaded weapon from directory
 AddWeapon getRangedWeapon()
          get any ranged loaded weapon from directory
 AddWeapon getWeapon(ItemType weaponType)
          Returns a weapon object for a specified weapon type, if the bot has it (otherwise returns null).
 boolean hasAnyLoadedWeapon()
          checks if agent has loaded weapon
 boolean hasLoadedWeapon()
          check if agent has any loaded weapon
 boolean hasWeaponOfType(ItemType type)
          search inventory for weapon of supplied type
 boolean isAmmoSuitable(Ammo ammo)
          check for suitability of an ammo (usualy one that agent currently sees)
 int numberOfLoadedWeapons()
          number of loaded weapons stored in inventory
 int numberOfWeapons()
          number of weapons stored in inventory
 

Method Detail

getAnyWeapon

AddWeapon getAnyWeapon()
get any loaded weapon from directory

Returns:
loaded weapon

getRangedWeapon

AddWeapon getRangedWeapon()
get any ranged loaded weapon from directory

Returns:
ranged loaded weapon

getMeleeWeapon

AddWeapon getMeleeWeapon()
get any melee loaded weapon from directory

Returns:
melee loaded weapon

isAmmoSuitable

boolean isAmmoSuitable(Ammo ammo)
check for suitability of an ammo (usualy one that agent currently sees)

Parameters:
ammo -
Returns:
true if the ammo type match to a weapon type in agent's inventory

hasLoadedWeapon

boolean hasLoadedWeapon()
check if agent has any loaded weapon

Returns:
true - agent has any loaded weapon

hasWeaponOfType

boolean hasWeaponOfType(ItemType type)
search inventory for weapon of supplied type

Parameters:
type -
Returns:
true if inventory contains searched weapon

hasAnyLoadedWeapon

boolean hasAnyLoadedWeapon()
checks if agent has loaded weapon

Returns:
true if agent has any loaded weapon in the inventory

getBetterWeapon

AddWeapon getBetterWeapon(Triple from,
                          Triple to)
Search inventory for better weapon - this is done according to distance between triples supplied as parameters.
The returned weapon has the lowest effective distance bigger than the distance between triples. For Example if the fighting agents are very close to each other and the one calling this function possesses flak cannon this method picks it as it has the lowest effective distance

Parameters:
from - - typically agent location
to - - typically enemy location
Returns:
better weapon or the same that agent is currently holding

numberOfWeapons

int numberOfWeapons()
number of weapons stored in inventory

Returns:
integer value

numberOfLoadedWeapons

int numberOfLoadedWeapons()
number of loaded weapons stored in inventory

Returns:
integer value

getAllWeapons

java.util.ArrayList<AddWeapon> getAllWeapons()
obtain a pointer on the structure in which inventory stores items

Returns:
array of AddWeapons - all even unloaded

getCopyOfAllWeapons

java.util.ArrayList<AddWeapon> getCopyOfAllWeapons()
obtain a copy of the structure in which inventory stores items

Returns:
array of AddWeapons - all even unloaded

getWeapon

AddWeapon getWeapon(ItemType weaponType)
Returns a weapon object for a specified weapon type, if the bot has it (otherwise returns null).

Parameters:
weaponType -
Returns: