cz.cuni.amis.pogamut.ut2004.agent.module.sensor
Class WeaponPrefsRange

java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.agent.module.sensor.WeaponPrefsRange

public class WeaponPrefsRange
extends java.lang.Object


Constructor Summary
protected WeaponPrefsRange(WeaponPrefs owner, double maxDistance)
           
  WeaponPrefsRange(WeaponPrefs owner, WeaponPrefsRange prefs)
           
 
Method Summary
 WeaponPrefsRange add(ItemType weapon, boolean usePrimaryMode)
          Adds another weapon as "the least preferable" one, i.e., you may define weapons from the most preferred to the least preferred by sequentially calling this method.
 WeaponPrefsRange add(Weapon weapon, boolean usePrimaryMode)
          Adds another weapon as "the least preferable" one, i.e., you may define weapons from the most preferred to the least preferred by sequentially calling this method.
 void clear()
          Clears all weapon preferences.
 double getMaxDistance()
          Maximum distance for preferences.
 double getMinDistance()
          Minimum distance for preferences.
 WeaponPrefs getOwner()
          Owner of this preferences.
 java.util.List<WeaponPref> getPrefs()
          Returns list of preferences (from the most preferred one to the least one).
 WeaponPref getWeaponPreference()
          Return the best weapon the bot has for a given distance.
 WeaponPref getWeaponPreference(ItemType... forbiddenWeapons)
          Return the best weapon the bot has for a given distance.
 WeaponPref getWeaponPreference(WeaponPref... forbiddenWeapons)
          Return the best weapon the bot has for a given distance.
 void setPrefs(java.util.List<WeaponPref> prefs)
          Set list of preferences to be used (from the most preferred one to the least one).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeaponPrefsRange

protected WeaponPrefsRange(WeaponPrefs owner,
                           double maxDistance)

WeaponPrefsRange

public WeaponPrefsRange(WeaponPrefs owner,
                        WeaponPrefsRange prefs)
Method Detail

add

public WeaponPrefsRange add(ItemType weapon,
                            boolean usePrimaryMode)
Adds another weapon as "the least preferable" one, i.e., you may define weapons from the most preferred to the least preferred by sequentially calling this method.

Parameters:
weapon - weapon to be used
usePrimaryMode - true == use primary firing mode, false == use secondary firing mode

add

public WeaponPrefsRange add(Weapon weapon,
                            boolean usePrimaryMode)
Adds another weapon as "the least preferable" one, i.e., you may define weapons from the most preferred to the least preferred by sequentially calling this method.

Parameters:
weapon - weapon to be used
usePrimaryMode - true == use primary firing mode, false == use secondary firing mode
Returns:

getMinDistance

public double getMinDistance()
Minimum distance for preferences.

Returns:

getMaxDistance

public double getMaxDistance()
Maximum distance for preferences.

Returns:

getWeaponPreference

public WeaponPref getWeaponPreference()
Return the best weapon the bot has for a given distance.

Returns:

getWeaponPreference

public WeaponPref getWeaponPreference(ItemType... forbiddenWeapons)
Return the best weapon the bot has for a given distance.

Parameters:
forbiddenWeapons - optionally, you may define weapons which bot should not choose (i.e. ItemType.ROCKET_LAUNCHER)
Returns:

getWeaponPreference

public WeaponPref getWeaponPreference(WeaponPref... forbiddenWeapons)
Return the best weapon the bot has for a given distance.

Parameters:
forbiddenWeapons - optionally, you may define weapons/mode-of-fire which bot should not choose.
Returns:

clear

public void clear()
Clears all weapon preferences.


getPrefs

public java.util.List<WeaponPref> getPrefs()
Returns list of preferences (from the most preferred one to the least one). You may alter it as you wish the class be using it.

Returns:

setPrefs

public void setPrefs(java.util.List<WeaponPref> prefs)
Set list of preferences to be used (from the most preferred one to the least one).

Parameters:
prefs -

getOwner

public WeaponPrefs getOwner()
Owner of this preferences.

Returns: