String getDebugDescription(boolean detailed) { if (size() == 0) { return "Empty FiringPlan!"; } StringBuilder description = new StringBuilder("Firing Plan for ").append(get(0).getShooter().getChassis()) .append(" at ") .append(getTarget().getDisplayName()) .append("; ").append(Integer.toString(size())) .append(" weapons fired "); if (detailed) { for (WeaponFireInfo weaponFireInfo : this) { description.append("\n\t\t").append(weaponFireInfo.getDebugDescription()); } } DecimalFormat decimalFormat = new DecimalFormat("0.00000"); description.append("\n\tTotal Expected Damage=").append(decimalFormat.format(getExpectedDamage())); description.append("\n\tTotal Expected Criticals=").append(decimalFormat.format(getExpectedCriticals())); description.append("\n\tKill Probability=").append(decimalFormat.format(getKillProbability())); description.append("\n\tUtility=").append(decimalFormat.format(getUtility())); return description.toString(); }
Mockito.when(mockPPCFireInfo.getWeapon()).thenReturn(mockPPC); Mockito.when(mockPPCFireInfo.getShooter()).thenReturn(mockShooter); Mockito.when(mockPPCFireInfo.getDebugDescription()).thenReturn("mock PPC"); alphaStrike.add(mockPPCFireInfo); Mockito.when(mockMLFireInfo.getWeapon()).thenReturn(mockML); Mockito.when(mockMLFireInfo.getShooter()).thenReturn(mockShooter); Mockito.when(mockMLFireInfo.getDebugDescription()).thenReturn("mock ML"); alphaStrike.add(mockMLFireInfo); Mockito.when(mockLRMFireInfo.getWeapon()).thenReturn(mockLRM5); Mockito.when(mockLRMFireInfo.getShooter()).thenReturn(mockShooter); Mockito.when(mockLRMFireInfo.getDebugDescription()).thenReturn("mock LRM"); alphaStrike.add(mockLRMFireInfo); Mockito.when(mockMGFireInfo.getWeapon()).thenReturn(mockMG); Mockito.when(mockMGFireInfo.getShooter()).thenReturn(mockShooter); Mockito.when(mockMGFireInfo.getDebugDescription()).thenReturn("mock MG"); alphaStrike.add(mockMGFireInfo);