Added imperial unit enum

This commit is contained in:
DarkGuardsman 2013-10-03 01:54:21 -04:00
parent c2218ada40
commit bd07aca95d
8 changed files with 57 additions and 4 deletions

View file

@ -1,5 +1,8 @@
package com.builtbroken.common;
/** Container for two objects
*
* @author Robert Seifert */
public class Pair<L, R>
{
private final L left;

View file

@ -1,4 +1,4 @@
package com.builtbroken.common;
package com.builtbroken.common.lang;
import java.awt.Color;

View file

@ -1,5 +1,8 @@
package com.builtbroken.common.science.units;
/** Units of measure for work with electricity
*
* @author Robert Seifert */
public enum ElectricUnit
{
AMPERE("Amp", "I"),

View file

@ -1,6 +1,6 @@
package com.builtbroken.common.science.units;
/** Units of messure for force
/** Units of measure for force
*
* @author Rsobert Seifert */
public enum ForceUnit

View 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;
}
}

View file

@ -1,5 +1,8 @@
package com.builtbroken.common.science.units;
/** Metric measurement system units
*
* @author Robert Seifert */
public enum MetricUnit
{
MICRO("Micro", "u", 0.000001f),

View file

@ -1,5 +1,8 @@
package com.builtbroken.common.science.units;
/** Units of measure for temperature
*
* @author Robert Seifert */
public enum TemperatureUnit
{
Fahrenheit("Fahrenheit", "F", new ITempConversion()
@ -58,7 +61,6 @@ public enum TemperatureUnit
public String name, symbol;
public ITempConversion conversion;
private TemperatureUnit(String name, String symbol, ITempConversion conversion)
{
this.name = name;

View file

@ -15,7 +15,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import universalelectricity.core.vector.Vector3;
import com.builtbroken.common.TextHelper.TextColor;
import com.builtbroken.common.lang.TextHelper.TextColor;
import dark.core.prefab.helpers.FluidHelper;