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

Refactor crime Difficulty setting #1498

Merged
merged 9 commits into from
Jan 11, 2025
Merged

Refactor crime Difficulty setting #1498

merged 9 commits into from
Jan 11, 2025

Conversation

DanRStevens
Copy link
Member

Set Difficulty in constructors of crime related classes. Store a const& to the original value, so we don't need to use setters to keep shadow copies up-to-date.


Work for:

Related to:

We want this field to be before classes that need access to this field.
This makes the difficulty a required parameter.
No changes needed at point of call for this.
By making this a reference, we can no longer update what is points to, so we need to remove the `difficulty` setter method. We also don't need the setter method, since storing a reference to the original value means we always have access to the original value. We no longer need a setter method to update shadow copies of the original value.
@DanRStevens DanRStevens requested a review from oscar139 January 10, 2025 21:55
@DanRStevens DanRStevens merged commit 42818ff into main Jan 11, 2025
7 checks passed
@DanRStevens DanRStevens deleted the refactorCrimeDifficulty branch January 11, 2025 15:22
@DanRStevens
Copy link
Member Author

Curiously, the GCC warning mentioned in Issue #1491 seems to have gone away after commit 823aa6d, despite that commit not attempting to address the warning. Although there were changes to the constructor init-list, it was adding new parameters, not removing the mNotificationArea parameter that was responsible for the warning.

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.

2 participants