Skip to content

Refactor shares percent to be polymorphic#6060

Merged
HammerGS merged 2 commits into
MegaMek:masterfrom
Algebro7:refactor/polymorphic-get-shares-pct
Feb 21, 2025
Merged

Refactor shares percent to be polymorphic#6060
HammerGS merged 2 commits into
MegaMek:masterfrom
Algebro7:refactor/polymorphic-get-shares-pct

Conversation

@Algebro7

Copy link
Copy Markdown
Collaborator

This is a pretty simple change--to prepare for further work on cleaning up the Contract APIs, I've refactored getSharesPercent() to simply be overridden by AtBContract rather than defining a new public function that "shouldn't be called" according to the old docstrings. This removes the hard dependency on AtBContract in Contract as it's no longer necessary to check what kind of object it is.

I've also added a couple of basic tests to verify that the existing functionality has not changed.

@HammerGS HammerGS merged commit ecb5ff8 into MegaMek:master Feb 21, 2025
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