Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CamOps Contract Market - Contract Generation #4967

Merged
merged 28 commits into from
Oct 11, 2024

Conversation

Algebro7
Copy link
Collaborator

@Algebro7 Algebro7 commented Oct 2, 2024

Opening this as a draft while I work on the next batch of functionality for the CamOps Contract Market. Any feedback welcome.

@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.45%. Comparing base (415ecaf) to head (3814786).
Report is 95 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4967      +/-   ##
============================================
- Coverage     10.47%   10.45%   -0.03%     
- Complexity     6021     6025       +4     
============================================
  Files           951      953       +2     
  Lines        133248   133600     +352     
  Branches      19377    19409      +32     
============================================
+ Hits          13961    13971      +10     
- Misses       117940   118285     +345     
+ Partials       1347     1344       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}
}

private static AtBContractType getCovertMission(int roll, int margin) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'roll' is never used.
@Algebro7
Copy link
Collaborator Author

Algebro7 commented Oct 3, 2024

I'm flipping this to ready for review. Much of the work for this phase is now done--the final things involve implementing negotiation of terms and extracting the payment formula out of Contract to make it CamOps compliant. Both will require substantial refactoring so I'd rather get this merged first before I start breaking other things.

@Algebro7 Algebro7 marked this pull request as ready for review October 3, 2024 18:40
@Algebro7 Algebro7 changed the title WIP: CamOps Contract Market - Contract Generation CamOps Contract Market - Contract Generation Oct 4, 2024
@Algebro7 Algebro7 force-pushed the camops-contract-market branch from cb929b2 to f6d64c3 Compare October 4, 2024 02:24
@@ -473,7 +472,7 @@ public double calculatePaymentMultiplier(Campaign campaign, AtBContract contract
}
}

multiplier *= contract.getContractType().getPaymentMultiplier();
multiplier *= contract.getContractType().getOperationsTempoMultiplier();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for including this. Will make implementing Fame & Infamy modifiers much easier.

Copy link
Collaborator

@IllianiCBT IllianiCBT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've marked this as 'request changes' as I do have a couple points of feedback.

The switch comments may well come down to personal preference. I find switches a lot easier to read at a glance. So, if you disagree, feel free to disregard those points.

We definitely need to add the legal notices to the top of any files that are missing them -- this is one I need to get better about, too, which is the only reason I knew to check.

If possible, I would really like to see you adopt either a dialog notice or selectively color-coded (and bolded) text for the follow-up contract notice. It also probably should be in a ResourceDialog.

@IllianiCBT
Copy link
Collaborator

IllianiCBT commented Oct 4, 2024

@HammerGS I'm going to be away for a couple of days so won't be able to do a follow-up review until Monday. So long as the legal notices are added and we (at least) get some color coding on the follow-up notice, I'm happy for this to be treated as 'approved' for the purposes of merging.

@Algebro7
Copy link
Collaborator Author

Algebro7 commented Oct 4, 2024

@IllianiCBT Thanks a lot for the review, those were all great points. I didn't know we had MathUtility.clamp() so that made a big difference on simplifying those massive if/else blocks.

I believe I've addressed all of your points except for improvements on the legacy followup contract notification, which we can implement as a separate PR.

@IllianiCBT
Copy link
Collaborator

Sorry for leaving you hanging, I completely forgot to approve this

@IllianiCBT IllianiCBT merged commit 8a09d8f into MegaMek:master Oct 11, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants