public class WeaponPrefsRange extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
WeaponPrefsRange(WeaponPrefs owner,
double maxDistance) |
|
WeaponPrefsRange(WeaponPrefs owner,
WeaponPrefsRange prefs) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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(List<WeaponPref> prefs)
Set list of preferences to be used (from the most preferred one to the least one).
|
protected WeaponPrefsRange(WeaponPrefs owner, double maxDistance)
public WeaponPrefsRange(WeaponPrefs owner, WeaponPrefsRange prefs)
public WeaponPrefsRange add(ItemType weapon, boolean usePrimaryMode)
weapon - weapon to be usedusePrimaryMode - true == use primary firing mode, false == use secondary firing modepublic WeaponPrefsRange add(Weapon weapon, boolean usePrimaryMode)
weapon - weapon to be usedusePrimaryMode - true == use primary firing mode, false == use secondary firing modepublic double getMinDistance()
public double getMaxDistance()
public WeaponPref getWeaponPreference()
public WeaponPref getWeaponPreference(ItemType... forbiddenWeapons)
forbiddenWeapons - optionally, you may define weapons which bot should not choose (i.e. ItemType.ROCKET_LAUNCHER)public WeaponPref getWeaponPreference(WeaponPref... forbiddenWeapons)
forbiddenWeapons - optionally, you may define weapons/mode-of-fire which bot should not choose.public void clear()
public List<WeaponPref> getPrefs()
public void setPrefs(List<WeaponPref> prefs)
prefs - public WeaponPrefs getOwner()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.