Enum Class ToastLevel
- All Implemented Interfaces:
Serializable,Comparable<ToastLevel>,Constable
Severity levels for board toast notifications. Each level defines a background color and how much longer than the
player's base display time its messages linger, so a more urgent level always outlasts a less urgent one no matter
where the player sets the base. Callers may override the duration outright for specific toasts.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA Game Master's action - purple, so it reads as the GM's hand rather than a game outcome. -
Method Summary
Modifier and TypeMethodDescriptionintReturns this level's display time, being the player's configured base duration plus this level's urgency offset.static ToastLevelReturns the enum constant of this class with the specified name.static ToastLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INFO
-
SUCCESS
-
WARNING
-
ERROR
-
GAMEMASTER
A Game Master's action - purple, so it reads as the GM's hand rather than a game outcome.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getBackgroundColor
-
getDefaultDurationMs
public int getDefaultDurationMs()Returns this level's display time, being the player's configured base duration plus this level's urgency offset. At the default base of 3 seconds this yields the long-standing 3s INFO/SUCCESS, 4s WARNING/GAMEMASTER and 5s ERROR timings.The settings spinner cannot go below
MIN_BASE_DURATION_SECONDS, but the stored value is clamped here as well so a hand-edited or corrupted preferences file cannot produce toasts that fade instantly.- Returns:
- the display time in milliseconds
-