diff options
Diffstat (limited to 'src/main/java/gregtech/common/power/Power.java')
-rw-r--r-- | src/main/java/gregtech/common/power/Power.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/main/java/gregtech/common/power/Power.java b/src/main/java/gregtech/common/power/Power.java new file mode 100644 index 0000000000..e0526c14aa --- /dev/null +++ b/src/main/java/gregtech/common/power/Power.java @@ -0,0 +1,48 @@ +package gregtech.common.power; + +import gregtech.api.util.GT_Utility; + +public abstract class Power { + protected final byte tier; + protected int recipeEuPerTick; + protected int recipeDuration; + + public Power(byte tier) { + this.tier = tier; + } + + public byte getTier() { + return tier; + } + + public abstract String getTierString(); + + /** + * This method should be called prior to usage of any value except the power tier. + */ + public abstract void computePowerUsageAndDuration(int euPerTick, int duration); + + public int getEuPerTick() { + return recipeEuPerTick; + } + + public int getDurationTicks() { + return recipeDuration; + } + + public double getDurationSeconds() { + return 0.05d * getDurationTicks(); + } + + public String getDurationString() { + return GT_Utility.formatNumbers(getDurationSeconds()) + GT_Utility.trans("161", " secs"); + } + + public abstract String getTotalPowerString(); + + public abstract String getPowerUsageString(); + + public abstract String getVoltageString(); + + public abstract String getAmperageString(); +} |