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

RepairRule as subclass to ProductionRule #12985

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

frigoref
Copy link
Member

@frigoref frigoref commented Nov 6, 2024

GameParser.java

  • use method replace instead of replaceAll
  • remove methods parseRepairCosts and parseRepairResults
  • parseRepairRules to reuse methods parseCosts and parseResults

Production.java

  • reverted in 2nd commit: let inner class RepairRule extend from inner class ProductionRule

ProductionRule.java

  • make private fields protected for visibility after inheritance

RepairRule.java

  • inherit from ProductionRule and remove duplicates

GameParser.java
- use method replace instead of replaceAll
- remove methods parseRepairCosts and parseRepairResults
- parseRepairRules to reuse methods parseCosts and parseResults

Production.java
- let inner class RepairRule extend from inner class ProductionRule

ProductionRule.java
- make private fields protected for visibility after inheritance

RepairRule.java
- inherit from ProductionRule and remove duplicates
GameParser.java
- use Production.RepairRule instead of Production.ProductionRule

Production.java
- Restore old static inner class Production.RepairRule
@frigoref
Copy link
Member Author

frigoref commented Nov 6, 2024

@DanVanAtta Do you see a way to use still let inner class RepairRule extend from inner class ProductionRule (in Production.java)?
When I tried to the first commit only, there were XML parsing errors, that I couldn't get fixed without reverting the changes.

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.

1 participant