public class MunitionsHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FIVELINE |
static java.lang.String |
NINELINE |
static java.lang.String |
TARGET |
static java.lang.String |
WPN_DISPLAY |
Constructor and Description |
---|
MunitionsHelper(MapView mapView,
PointMapItem target,
java.lang.String fromLine) |
Modifier and Type | Method and Description |
---|---|
void |
addRangeRings() |
void |
addRangeRings(boolean visible)
Add range rings based on weapon metadata
|
void |
addWeapon(java.lang.String categoryName,
java.lang.String weaponName,
java.lang.String description,
int inner,
int outer)
Add a weapon to the munitions map
|
RangeRing |
createRangeRing(WeaponData weapon)
Create a range ring for a specific weapon
|
RangeRing |
findRangeRing(java.lang.String weaponName)
Find the range ring for the given weapon name
|
java.util.List<RangeRing> |
findRangeRings()
Find all range rings attached to the target
|
void |
forEachCategory(CategoryConsumer consumer)
Loop through each category in the metadata map
|
void |
forEachWeapon(WeaponConsumer consumer)
Loop through each weapon in the metadata map
|
int |
getWeaponsCount()
Get the total number of weapons
|
static boolean |
hasNoLine(java.lang.String fromLine) |
boolean |
isVisible() |
boolean |
isVisible(boolean defaultVisible)
Get munitions visibility
|
void |
persist()
Persist the target
|
void |
removeAllWeapons()
Remove all weapons and associated range rings
|
void |
removeRangeRing(RangeRing r,
boolean removeWeapon)
Remove the range ring from the map (and map view)
|
void |
removeRangeRings()
Remove all range rings that apply to this target (and line)
Does NOT remove the weapon entries
|
void |
removeWeapon(java.lang.String categoryName,
java.lang.String weaponName)
Remove a weapon from the munitions map
This method will also remove the category map if it's empty
|
void |
setRangeRingsVisible(boolean visible)
Set the visibility of all range rings
|
void |
setVisible(boolean visible)
Set munitions visibility
|
public static final java.lang.String WPN_DISPLAY
public static final java.lang.String NINELINE
public static final java.lang.String FIVELINE
public static final java.lang.String TARGET
public MunitionsHelper(MapView mapView, PointMapItem target, java.lang.String fromLine)
public void addWeapon(java.lang.String categoryName, java.lang.String weaponName, java.lang.String description, int inner, int outer)
categoryName
- Weapon category nameweaponName
- Weapon namedescription
- Descriptioninner
- Inner (prone) radiusouter
- Outer (standing) radiuspublic void removeWeapon(java.lang.String categoryName, java.lang.String weaponName)
categoryName
- Category nameweaponName
- Weapon namepublic void removeAllWeapons()
public int getWeaponsCount()
public void setVisible(boolean visible)
visible
- True if visiblepublic boolean isVisible(boolean defaultVisible)
defaultVisible
- True if this set of munitions is visible by defaultpublic boolean isVisible()
public RangeRing createRangeRing(WeaponData weapon)
weapon
- Weapon datapublic java.util.List<RangeRing> findRangeRings()
public RangeRing findRangeRing(java.lang.String weaponName)
weaponName
- Weapon namepublic void removeRangeRing(RangeRing r, boolean removeWeapon)
r
- Range ringremoveWeapon
- True to remove the matching weapon entrypublic void setRangeRingsVisible(boolean visible)
visible
- True if visiblepublic void addRangeRings(boolean visible)
public void addRangeRings()
public void removeRangeRings()
public void persist()
public void forEachCategory(CategoryConsumer consumer)
consumer
- Consumerpublic void forEachWeapon(WeaponConsumer consumer)
consumer
- Consumerpublic static boolean hasNoLine(java.lang.String fromLine)