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

Refactored Fixed Experience Level Person Generation in Bulk Recruitment #4590

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

IllianiCBT
Copy link
Collaborator

This PR refactors the method by which we generate personnel at a fixed experience level during bulk recruitment. This was an option added a little while ago, but the implementation was... well, it wasn't great. Previously we looped until the right experience level was hit. This was possibly the most expensive way I could have accomplished the task and I've been looking for an excuse to redo it ever since it got merged.

Now, we just fetch the profession requested and then overwrite the randomized skill levels for that profession, replacing them with the fixed values. This is substantially quicker, and far more reliable than the earlier approach.

Closes #4579

Added a new method to override skills for personnel during hire bulk operations. This method assigns skills according to the primary role and desired experience level, ensuring consistency and efficiency in skill generation.
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.31%. Comparing base (a684cf7) to head (1cd372a).
Report is 9 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4590      +/-   ##
============================================
- Coverage     10.31%   10.31%   -0.01%     
  Complexity     5818     5818              
============================================
  Files           936      936              
  Lines        128889   128964      +75     
  Branches      18960    18965       +5     
============================================
  Hits          13301    13301              
- Misses       114312   114387      +75     
  Partials       1276     1276              

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

@IllianiCBT IllianiCBT merged commit 5c35826 into MegaMek:master Aug 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Nightly) Freeze when bulk-hiring at invalid skill level
3 participants