Class Arithmetics
java.lang.Object
net.dillon.dillonlib.util.Arithmetics
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intM_asTick(int minutesAsTicks) Convertsminutesto ticks.static booleanpercentChance(float chance) static floatrangedPercentChance(float min, float max) static intrangedPercentChance(int min, int max) static doubleroundToHundredths(double d) Rounds a value to the nearest hundredths place.static doubleroundToTenths(double d) Rounds the value to the nearest tenths place.static intS_asTick(int secondsAsTicks) Convertssecondsto ticks.
-
Constructor Details
-
Arithmetics
public Arithmetics()
-
-
Method Details
-
S_asTick
public static int S_asTick(int secondsAsTicks) Convertssecondsto ticks. -
M_asTick
public static int M_asTick(int minutesAsTicks) Convertsminutesto ticks. -
roundToTenths
public static double roundToTenths(double d) Rounds the value to the nearest tenths place. -
roundToHundredths
public static double roundToHundredths(double d) Rounds a value to the nearest hundredths place. -
percentChance
public static boolean percentChance(float chance) - Returns:
truewith the specified percentage chance (0-100).
-
rangedPercentChance
public static float rangedPercentChance(float min, float max) - Returns:
- a random float, with a minimum and maximum value.
-
rangedPercentChance
public static int rangedPercentChance(int min, int max) - Returns:
- a random int, with a minimum and maximum value.
-