From 31e1ef59d3ca940c1c89e6f0962fa18e5b980fb0 Mon Sep 17 00:00:00 2001 From: sleet01 Date: Mon, 6 May 2024 09:59:24 -0700 Subject: [PATCH] Revert types in new tests from backported fix #5415 --- megamek/src/megamek/client/bot/princess/Princess.java | 2 +- .../megamek/client/bot/princess/PrincessTest.java | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/megamek/src/megamek/client/bot/princess/Princess.java b/megamek/src/megamek/client/bot/princess/Princess.java index b63f00d33df..8d9896e9210 100644 --- a/megamek/src/megamek/client/bot/princess/Princess.java +++ b/megamek/src/megamek/client/bot/princess/Princess.java @@ -735,7 +735,7 @@ protected void calculateTargetingOffBoardTurn() { sendDone(true); } - private Map calcAmmoConservation(final Entity shooter) { + protected Map calcAmmoConservation(final Entity shooter) { final double aggroFactor = getBehaviorSettings().getHyperAggressionIndex(); final StringBuilder msg = new StringBuilder("\nCalculating ammo conservation for ") .append(shooter.getDisplayName()); diff --git a/megamek/unittests/megamek/client/bot/princess/PrincessTest.java b/megamek/unittests/megamek/client/bot/princess/PrincessTest.java index 65eed94bf5c..075f412c243 100644 --- a/megamek/unittests/megamek/client/bot/princess/PrincessTest.java +++ b/megamek/unittests/megamek/client/bot/princess/PrincessTest.java @@ -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; @@ -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 conserveMap = mockPrincess.calcAmmoConservation(mech1); + Map conserveMap = mockPrincess.calcAmmoConservation(mech1); assertTrue(conserveMap.get(wpn1) <= target); // Default toHitThreshold for 3+ rounds for this level should allow firing on 11s @@ -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 conserveMap = mockPrincess.calcAmmoConservation(mech1); + Map conserveMap = mockPrincess.calcAmmoConservation(mech1); assertTrue(conserveMap.get(wpn1) <= target); // Default toHitThreshold for 3+ rounds for this level should allow firing on 12s @@ -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 conserveMap = mockPrincess.calcAmmoConservation(mech1); + Map conserveMap = mockPrincess.calcAmmoConservation(mech1); assertTrue(conserveMap.get(wpn1) <= target); // Default toHitThreshold for 3+ rounds for this level should allow firing on 11s @@ -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 conserveMap = mockPrincess.calcAmmoConservation(mech1); + Map conserveMap = mockPrincess.calcAmmoConservation(mech1); assertTrue(conserveMap.get(wpn1) <= target); // For default aggro, shoot OS weapons at TN 9 or better