Files
Blacksmith/src/main/java/net/knarcraft/blacksmith/formatting/TimeInterval.java

66 lines
1.6 KiB
Java

package net.knarcraft.blacksmith.formatting;
/**
* The important intervals when not using exact wait times
*/
public enum TimeInterval {
/**
* Less than 10 seconds left
*/
INTERVAL_LESS_THAN_10_SECONDS("in just a moment", 10),
/**
* Less than 30 seconds left
*/
INTERVAL_LESS_THAN_30_SECONDS("in a little while", 30),
/**
* Less than 1 minute left
*/
INTERVAL_LESS_THAN_1_MINUTE("in a while", 60),
/**
* Less than 5 minutes left
*/
INTERVAL_LESS_THAN_5_MINUTES("after some time", 300),
/**
* More than 5 minutes left
*/
INTERVAL_MORE_THAN_5_MINUTES("in quite a while", Integer.MAX_VALUE);
private final String defaultText;
private final int maxSeconds;
/**
* Instantiates a new time interval
*
* @param defaultText <p>The default text used to describe the time interval</p>
* @param maxSeconds <p>The maximum number of seconds to fall within this interval</p>
*/
TimeInterval(String defaultText, int maxSeconds) {
this.defaultText = defaultText;
this.maxSeconds = maxSeconds;
}
/**
* Gets the default text to display for this interval
*
* @return <p>The default text to display for this interval</p>
*/
public String getDefaultText() {
return this.defaultText;
}
/**
* Gets the maximum number of seconds before exceeding this interval
*
* @return <p>The max seconds of this interval</p>
*/
public int getIntervalMax() {
return maxSeconds;
}
}