Skip to content

Commit

Permalink
Simplified resupply smuggler message formatting.
Browse files Browse the repository at this point in the history
Refactored the message generation to combine the value string directly within the formatted output. This reduces intermediate variables and improves code clarity.
  • Loading branch information
IllianiCBT committed Dec 21, 2024
1 parent 9c87518 commit 08dd0b1
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,14 @@ private static String getInitialDescription(Resupply resupply) {
yield String.format(message, value);
}
case RESUPPLY_SMUGGLER -> {
String message = String.format(
resources.getString("guerrillaSupplies" + randomInt(25) + ".text"),
campaign.getCommanderAddress(true), getEnemyFactionReference(resupply),
resupply.getConvoyContentsValueCalculated().toAmountAndSymbolString());

String value = String.format(resources.getString("supplyCostFull.text"),
resupply.getConvoyContentsValueCalculated().toAmountAndSymbolString(),
resupply.getConvoyContentsValueBase().toAmountAndSymbolString());

yield String.format(message, value);
yield String.format(
resources.getString("guerrillaSupplies" + randomInt(25) + ".text"),
campaign.getCommanderAddress(true), getEnemyFactionReference(resupply),
resupply.getConvoyContentsValueCalculated().toAmountAndSymbolString(), value);
}
};
}
Expand Down

0 comments on commit 08dd0b1

Please sign in to comment.