Class MunitionWeightCollection

java.lang.Object
megamek.client.generator.MunitionWeightCollection

public class MunitionWeightCollection extends Object
  • Method Details

    • resetWeights

      public void resetWeights()
    • setIncendiary

      public HashMap<String,Double> setIncendiary(HashMap<String,Double> original)
      We want to be able to search for valid LRM munitions types that also include 'w/ Incendiary', without having to track every IS/Clan, rack size, Mek/BA/Infantry weapon, OS/not OS, etc. combination.

      For now, MunitionTree adds a version of each ammo type string with ' w/ Incendiary' appended; here we set the weights at 0.8 x the original value (representing 20% damage loss from Incendiary).

      Returns:
      original, but modified
    • increaseMunitions

      public void increaseMunitions(List<String> munitions)
    • decreaseMunitions

      public void decreaseMunitions(List<String> munitions)
    • zeroMunitionsWeight

      public void zeroMunitionsWeight(List<String> munitions)
    • increaseAPMunitions

      public void increaseAPMunitions()
    • decreaseAPMunitions

      public void decreaseAPMunitions()
    • increaseFlakMunitions

      public void increaseFlakMunitions()
    • decreaseFlakMunitions

      public void decreaseFlakMunitions()
    • increaseAccurateMunitions

      public void increaseAccurateMunitions()
    • decreaseAccurateMunitions

      @Deprecated(since="0.51.0", forRemoval=true) public void decreaseAccurateMunitions()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • increaseAntiInfMunitions

      public void increaseAntiInfMunitions()
    • decreaseAntiInfMunitions

      public void decreaseAntiInfMunitions()
    • increaseAntiBAMunitions

      public void increaseAntiBAMunitions()
    • decreaseAntiBAMunitions

      @Deprecated(since="0.51.0", forRemoval=true) public void decreaseAntiBAMunitions()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • increaseHeatMunitions

      public void increaseHeatMunitions()
    • decreaseHeatMunitions

      public void decreaseHeatMunitions()
    • increaseIlluminationMunitions

      public void increaseIlluminationMunitions()
    • decreaseIlluminationMunitions

      public void decreaseIlluminationMunitions()
    • increaseUtilityMunitions

      @Deprecated(since="0.51.0", forRemoval=true) public void increaseUtilityMunitions()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • decreaseUtilityMunitions

      public void decreaseUtilityMunitions()
    • increaseArtilleryUtilityMunitions

      public void increaseArtilleryUtilityMunitions()
    • decreaseArtilleryUtilityMunitions

      @Deprecated(since="0.51.0", forRemoval=true) public void decreaseArtilleryUtilityMunitions()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • increaseGuidedMunitions

      public void increaseGuidedMunitions()
    • increaseTagGuidedMunitions

      public void increaseTagGuidedMunitions()
    • increaseNARCGuidedMunitions

      public void increaseNARCGuidedMunitions()
    • decreaseGuidedMunitions

      public void decreaseGuidedMunitions()
    • decreaseTagGuidedMunitions

      public void decreaseTagGuidedMunitions()
    • decreaseNARCGuidedMunitions

      @Deprecated(since="0.51.0", forRemoval=true) public void decreaseNARCGuidedMunitions()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • increaseAmmoReducingMunitions

      public void increaseAmmoReducingMunitions()
    • decreaseAmmoReducingMunitions

      public void decreaseAmmoReducingMunitions()
    • increaseSeekingMunitions

      public void increaseSeekingMunitions()
    • decreaseSeekingMunitions

      public void decreaseSeekingMunitions()
    • increaseHighPowerMunitions

      public void increaseHighPowerMunitions()
    • decreaseHighPowerMunitions

      @Deprecated(since="0.51.0", forRemoval=true) public void decreaseHighPowerMunitions()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getMunitionTypesInWeightOrder

      public List<String> getMunitionTypesInWeightOrder(Map<String,Double> weightMap)
    • getAboveCutoff

      public HashMap<String,List<String>> getAboveCutoff(double cutoff)
      Select all munitions with weights above the cutoff value.
      Parameters:
      cutoff - Double cutoff weight; munitions with this weight or lower are discarded
      Returns:
      HashMap of lists of munitions, by weapon type, in weight order
    • getTopN

      public HashMap<String,List<String>> getTopN(int count)
      Select the top N weighted munitions of each type, where N is the count to include.
      Parameters:
      count - Int count of top munition types to include.
      Returns:
      HashMap of lists of munitions, by weapon type, in weight order
    • getLrmWeights

      public HashMap<String,Double> getLrmWeights()
    • getSrmWeights

      public HashMap<String,Double> getSrmWeights()
    • getAcWeights

      @Deprecated(since="0.51.0", forRemoval=true) public HashMap<String,Double> getAcWeights()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getAtmWeights

      @Deprecated(since="0.51.0", forRemoval=true) public HashMap<String,Double> getAtmWeights()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getArrowWeights

      @Deprecated(since="0.51.0", forRemoval=true) public HashMap<String,Double> getArrowWeights()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getLongTomWeights

      public HashMap<String,Double> getLongTomWeights()
    • getSniperWeights

      @Deprecated(since="0.51.0", forRemoval=true) public HashMap<String,Double> getSniperWeights()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getThumperWeights

      @Deprecated(since="0.51.0", forRemoval=true) public HashMap<String,Double> getThumperWeights()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getBombWeights

      public HashMap<String,Double> getBombWeights()
    • getLongTomCannonWeights

      @Deprecated(since="0.51.0", forRemoval=true) public HashMap<String,Double> getLongTomCannonWeights()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getSniperCannonWeights

      @Deprecated(since="0.51.0", forRemoval=true) public HashMap<String,Double> getSniperCannonWeights()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getThumperCannonWeights

      @Deprecated(since="0.51.0", forRemoval=true) public HashMap<String,Double> getThumperCannonWeights()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getMortarWeights

      @Deprecated(since="0.51.0", forRemoval=true) public HashMap<String,Double> getMortarWeights()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getMunitionWeights

      @Nullable public HashMap<String,Double> getMunitionWeights(String key)