NOVA-Team / NOVA-Monorepo

The core API of the NOVA voxel game modding system
https://nova-team.github.io
GNU Lesser General Public License v3.0
66 stars 23 forks source link

Move Unit from Energy to Core #271

Open ExE-Boss opened 7 years ago

ExE-Boss commented 7 years ago

This PR will move Unit from Energy to Core.

Reason:

Unit seems like a class that would benefit more from being in Core than in Energy.

Other changes:

UnitDisplay is now immutable, and accepts a DoubleSupplier to allow linking to a getter. Example:

UnitDisplay display = new UnitDisplay(Unit.JOULE, components.get(EnergyStorage.class)::getEnergy);

Modded Minecraft energy units were left out and will be added by NOVA-Team/NOVA-Energy#3.

codecov-io commented 7 years ago

Codecov Report

Merging #271 into master will increase coverage by 0.16%. The diff coverage is 21.17%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #271      +/-   ##
============================================
+ Coverage     13.58%   13.74%   +0.16%     
- Complexity      732      762      +30     
============================================
  Files           409      413       +4     
  Lines         12788    13010     +222     
  Branches       1354     1380      +26     
============================================
+ Hits           1737     1788      +51     
- Misses        10934    11107     +173     
+ Partials        117      115       -2
Impacted Files Coverage Δ Complexity Δ
.../main/java/nova/core/util/unit/UnitConversion.java 0% <0%> (ø) 0 <0> (?)
src/main/java/nova/core/util/unit/UnitDisplay.java 0% <0%> (ø) 0 <0> (?)
src/main/java/nova/core/util/unit/Unit.java 0% <0%> (ø) 0 <0> (?)
src/main/java/nova/core/util/unit/UnitPrefix.java 100% <100%> (ø) 10 <10> (?)
src/main/java/nova/core/util/math/MathUtil.java 86.17% <81.48%> (+4.08%) 65 <18> (+20) :arrow_up:

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 f8daac6...9eda38e. Read the comment docs.

ExE-Boss commented 7 years ago

Changes implemented and rebased to master