Skip to content

Commit

Permalink
implement addAtBContract
Browse files Browse the repository at this point in the history
  • Loading branch information
Algebro7 committed Sep 25, 2024
1 parent a79000f commit dcf55ed
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public CamOpsContractMarket() {

@Override
public AtBContract addAtBContract(Campaign campaign) {
Optional<AtBContract> c = generateContract(campaign);
if (c.isPresent()) {
AtBContract atbContract = c.get();
contracts.add(atbContract);
return atbContract;
}
return null;
}

Expand All @@ -58,8 +64,7 @@ public void generateContractOffers(Campaign campaign, boolean newCampaign) {
rollNegotiation(negotiationSkill, ratingMod + contractMods.offersMod) - BASE_NEGOTIATION_TARGET);

for (int i = 0; i < numOffers; i++) {
Optional<AtBContract> c = generateContract(campaign);
c.ifPresent(contract -> contracts.add(contract));
addAtBContract(campaign);
}
updateReport(campaign);
}
Expand Down

0 comments on commit dcf55ed

Please sign in to comment.