Skip to content

Commit

Permalink
Revert types in new tests from backported fix MegaMek#5415
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleet01 committed May 6, 2024
1 parent de605db commit 31e1ef5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion megamek/src/megamek/client/bot/princess/Princess.java
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ protected void calculateTargetingOffBoardTurn() {
sendDone(true);
}

private Map<Mounted, Double> calcAmmoConservation(final Entity shooter) {
protected Map<Mounted, Double> calcAmmoConservation(final Entity shooter) {
final double aggroFactor = getBehaviorSettings().getHyperAggressionIndex();
final StringBuilder msg = new StringBuilder("\nCalculating ammo conservation for ")
.append(shooter.getDisplayName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import megamek.client.bot.princess.PathRanker.PathRankerType;
import megamek.common.*;
import megamek.common.enums.GamePhase;
import megamek.common.equipment.WeaponMounted;
import megamek.common.options.GameOptions;
import megamek.common.options.OptionsConstants;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -561,7 +560,7 @@ public void testCalcAmmoForDefaultAggressionLevel() throws megamek.common.Locati
// Default toHitThreshold for 7+ rounds for this level should allow firing on 12s
double target = Compute.oddsAbove(12) / 100.0;
bin1.setShotsLeft(7);
Map<WeaponMounted, Double> conserveMap = mockPrincess.calcAmmoConservation(mech1);
Map<Mounted, Double> conserveMap = mockPrincess.calcAmmoConservation(mech1);
assertTrue(conserveMap.get(wpn1) <= target);

// Default toHitThreshold for 3+ rounds for this level should allow firing on 11s
Expand Down Expand Up @@ -596,7 +595,7 @@ public void testCalcAmmoForMaxAggressionLevel() throws megamek.common.LocationFu
// Default toHitThreshold for 7+ rounds for this level should allow firing on 12s
double target = Compute.oddsAbove(12) / 100.0;
bin1.setShotsLeft(7);
Map<WeaponMounted, Double> conserveMap = mockPrincess.calcAmmoConservation(mech1);
Map<Mounted, Double> conserveMap = mockPrincess.calcAmmoConservation(mech1);
assertTrue(conserveMap.get(wpn1) <= target);

// Default toHitThreshold for 3+ rounds for this level should allow firing on 12s
Expand Down Expand Up @@ -630,7 +629,7 @@ public void testCalcAmmoForZeroAggressionLevel() throws megamek.common.LocationF
// Default toHitThreshold for 7+ rounds for this level should allow firing on 12s
double target = Compute.oddsAbove(10) / 100.0;
bin1.setShotsLeft(7);
Map<WeaponMounted, Double> conserveMap = mockPrincess.calcAmmoConservation(mech1);
Map<Mounted, Double> conserveMap = mockPrincess.calcAmmoConservation(mech1);
assertTrue(conserveMap.get(wpn1) <= target);

// Default toHitThreshold for 3+ rounds for this level should allow firing on 11s
Expand Down Expand Up @@ -660,7 +659,7 @@ public void testCalcAmmoForOneShotWeapons() throws megamek.common.LocationFullEx
// Check default toHitThresholds
// For max aggro, shoot OS weapons at TN 10 or better
double target = Compute.oddsAbove(8) / 100.0;
Map<WeaponMounted, Double> conserveMap = mockPrincess.calcAmmoConservation(mech1);
Map<Mounted, Double> conserveMap = mockPrincess.calcAmmoConservation(mech1);
assertTrue(conserveMap.get(wpn1) <= target);

// For default aggro, shoot OS weapons at TN 9 or better
Expand Down

0 comments on commit 31e1ef5

Please sign in to comment.