Added imperial unit enum
This commit is contained in:
parent
c2218ada40
commit
bd07aca95d
8 changed files with 57 additions and 4 deletions
|
@ -1,5 +1,8 @@
|
||||||
package com.builtbroken.common;
|
package com.builtbroken.common;
|
||||||
|
|
||||||
|
/** Container for two objects
|
||||||
|
*
|
||||||
|
* @author Robert Seifert */
|
||||||
public class Pair<L, R>
|
public class Pair<L, R>
|
||||||
{
|
{
|
||||||
private final L left;
|
private final L left;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.builtbroken.common;
|
package com.builtbroken.common.lang;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.builtbroken.common.science.units;
|
package com.builtbroken.common.science.units;
|
||||||
|
|
||||||
|
/** Units of measure for work with electricity
|
||||||
|
*
|
||||||
|
* @author Robert Seifert */
|
||||||
public enum ElectricUnit
|
public enum ElectricUnit
|
||||||
{
|
{
|
||||||
AMPERE("Amp", "I"),
|
AMPERE("Amp", "I"),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.builtbroken.common.science.units;
|
package com.builtbroken.common.science.units;
|
||||||
|
|
||||||
/** Units of messure for force
|
/** Units of measure for force
|
||||||
*
|
*
|
||||||
* @author Rsobert Seifert */
|
* @author Rsobert Seifert */
|
||||||
public enum ForceUnit
|
public enum ForceUnit
|
||||||
|
|
42
src/com/builtbroken/common/science/units/ImperialUnits.java
Normal file
42
src/com/builtbroken/common/science/units/ImperialUnits.java
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
package com.builtbroken.common.science.units;
|
||||||
|
|
||||||
|
/** @Source http://en.wikipedia.org/wiki/Imperial_units
|
||||||
|
* @author Robert Seifert */
|
||||||
|
public enum ImperialUnits
|
||||||
|
{
|
||||||
|
thou("thou", "th", (float) (1 / 12000)),
|
||||||
|
inch("inch", "in", (float) (1 / 12)),
|
||||||
|
foot("foot", "ft", 1),
|
||||||
|
yard("yard", "yd", 3),
|
||||||
|
chain("chain", "ch", 66),
|
||||||
|
furlong("furlong", "fur", 660),
|
||||||
|
mile("mile", "mi", 5280),
|
||||||
|
|
||||||
|
/** Not official used anymore */
|
||||||
|
league("league", "lea", 15840),
|
||||||
|
|
||||||
|
/** Maritime units */
|
||||||
|
fathom("fathom", "ftm", 6.08f),
|
||||||
|
/** Maritime units */
|
||||||
|
cable("cable", "", 608),
|
||||||
|
/** Maritime units */
|
||||||
|
nautical("nautical mile", "", 6080),
|
||||||
|
|
||||||
|
/** Gunter's sruvey unit */
|
||||||
|
link("link", "", (float) (66 / 100)),
|
||||||
|
/** Gunter's sruvey unit */
|
||||||
|
rod("rod", "", (float) (66 / 4));
|
||||||
|
|
||||||
|
public String name, symbol;
|
||||||
|
float toFeet;
|
||||||
|
|
||||||
|
public static final ImperialUnits[] mainUnits = { inch, foot, yard, mile };
|
||||||
|
|
||||||
|
private ImperialUnits(String name, String symbol, float toFeet)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
this.symbol = symbol;
|
||||||
|
this.toFeet = toFeet;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,8 @@
|
||||||
package com.builtbroken.common.science.units;
|
package com.builtbroken.common.science.units;
|
||||||
|
|
||||||
|
/** Metric measurement system units
|
||||||
|
*
|
||||||
|
* @author Robert Seifert */
|
||||||
public enum MetricUnit
|
public enum MetricUnit
|
||||||
{
|
{
|
||||||
MICRO("Micro", "u", 0.000001f),
|
MICRO("Micro", "u", 0.000001f),
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.builtbroken.common.science.units;
|
package com.builtbroken.common.science.units;
|
||||||
|
|
||||||
|
/** Units of measure for temperature
|
||||||
|
*
|
||||||
|
* @author Robert Seifert */
|
||||||
public enum TemperatureUnit
|
public enum TemperatureUnit
|
||||||
{
|
{
|
||||||
Fahrenheit("Fahrenheit", "F", new ITempConversion()
|
Fahrenheit("Fahrenheit", "F", new ITempConversion()
|
||||||
|
@ -58,7 +61,6 @@ public enum TemperatureUnit
|
||||||
public String name, symbol;
|
public String name, symbol;
|
||||||
public ITempConversion conversion;
|
public ITempConversion conversion;
|
||||||
|
|
||||||
|
|
||||||
private TemperatureUnit(String name, String symbol, ITempConversion conversion)
|
private TemperatureUnit(String name, String symbol, ITempConversion conversion)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
import net.minecraftforge.fluids.IFluidHandler;
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
import universalelectricity.core.vector.Vector3;
|
import universalelectricity.core.vector.Vector3;
|
||||||
|
|
||||||
import com.builtbroken.common.TextHelper.TextColor;
|
import com.builtbroken.common.lang.TextHelper.TextColor;
|
||||||
|
|
||||||
import dark.core.prefab.helpers.FluidHelper;
|
import dark.core.prefab.helpers.FluidHelper;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue