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

274: Moving Era Definitions to Data #2805

Merged
merged 6 commits into from
Aug 24, 2021

Conversation

Windchild292
Copy link
Contributor

This fixes #274 by rewriting eras and moving them to file. They're barely used currently, but having a more robust and customizable system should help in the future.

@Windchild292 Windchild292 added the (RFE) Enhancement Requests for Enhancement, new features or implementations label Aug 14, 2021
@Windchild292 Windchild292 self-assigned this Aug 14, 2021
@codecov
Copy link

codecov bot commented Aug 14, 2021

Codecov Report

Merging #2805 (3a471af) into master (6e61900) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2805   +/-   ##
=========================================
  Coverage     10.61%   10.61%           
- Complexity     3870     3878    +8     
=========================================
  Files           717      719    +2     
  Lines        100256   100317   +61     
  Branches      16423    16423           
=========================================
+ Hits          10639    10649   +10     
- Misses        88229    88288   +59     
+ Partials       1388     1380    -8     
Impacted Files Coverage Δ
MekHQ/src/mekhq/MekHqConstants.java 0.00% <ø> (ø)
MekHQ/src/mekhq/campaign/Campaign.java 11.86% <0.00%> (+<0.01%) ⬆️
...hq/campaign/mission/AtBDynamicScenarioFactory.java 1.59% <0.00%> (ø)
...kHQ/src/mekhq/campaign/universe/enums/EraFlag.java 0.00% <0.00%> (ø)
MekHQ/src/mekhq/campaign/universe/eras/Era.java 0.00% <0.00%> (ø)
MekHQ/src/mekhq/campaign/universe/eras/Eras.java 0.00% <0.00%> (ø)
MekHQ/src/mekhq/gui/dialog/DataLoadingDialog.java 0.00% <0.00%> (ø)
MekHQ/src/mekhq/campaign/universe/Systems.java 41.43% <0.00%> (-0.80%) ⬇️
MekHQ/src/mekhq/campaign/universe/Faction.java 66.02% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6e61900...3a471af. Read the comment docs.

Copy link
Member

@NickAragua NickAragua left a comment

Choose a reason for hiding this comment

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

One suggestion.

MekHQ/src/mekhq/campaign/universe/eras/Eras.java Outdated Show resolved Hide resolved

MekHQ.getLogger().error("Failed to determine a valid era for the date " + today);
return getEras().values().stream().findFirst().orElse(new Era());
return getEras().ceilingEntry(today).getValue();
Copy link
Member

Choose a reason for hiding this comment

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

I assume this works for dates past ilClan?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ilClan doesn't have an end date, so it uses the default of 01-01-9999... which should handle any dates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(RFE) Enhancement Requests for Enhancement, new features or implementations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Move era definitions to an XML file
3 participants