Enum Class Ability
- All Implemented Interfaces:
Serializable
,Comparable<Ability>
,Constable
Ability scores enumeration and methods.
- Since:
- 2014-05-21
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static enum
Available ability bonus rules.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final Ability[][]
Prioritized preference for any class based on prime requisite.private static final Ability.BonusRule
Constant switch for bonus formula.private static final int[]
Array of B/X style ability bonuses (for performance.)private static final int[]
Array of OED style ability bonuses (for performance).private static final String[]
Long-form names for abilities. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
bonusPercentXP
(int score) Return bonus percent of XP for prime requisite.static int
getBonus
(int score) Gives the bonus for a given ability score.(package private) static int
getBonusBX
(int score) BX-style bonus for a given ability score.(package private) static int
getBonusOED
(int score) OED-style bonus for a given ability score.static String
getFullName
(Ability ability) Get long-form name for an ability.static Ability[]
getPriorityList
(Ability primeReq) Get ability priority list based on prime requisite.static void
Main test function.static Ability
Returns the enum constant of this class with the specified name.static Ability[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Str
-
Int
-
Wis
-
Dex
-
Con
-
Cha
-
-
Field Details
-
BONUS_RULE
Constant switch for bonus formula. -
abilityPriority
Prioritized preference for any class based on prime requisite. -
fullName
Long-form names for abilities. -
BonusValueBX
private static final int[] BonusValueBXArray of B/X style ability bonuses (for performance.) -
BonusValueOED
private static final int[] BonusValueOEDArray of OED style ability bonuses (for performance).
-
-
Constructor Details
-
Ability
private Ability()
-
-
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
-
getFullName
Get long-form name for an ability. -
getBonus
public static int getBonus(int score) Gives the bonus for a given ability score. -
getBonusBX
static int getBonusBX(int score) BX-style bonus for a given ability score. -
getBonusOED
static int getBonusOED(int score) OED-style bonus for a given ability score. -
bonusPercentXP
public static int bonusPercentXP(int score) Return bonus percent of XP for prime requisite. -
getPriorityList
Get ability priority list based on prime requisite. -
main
Main test function.
-