public class SavingThrows extends Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
SavingThrows.SaveRecord |
static class |
SavingThrows.SaveType
Saving throw types.
|
Modifier and Type | Field and Description |
---|---|
(package private) static SavingThrows |
instance
The singleton class instance.
|
(package private) String |
SAVING_THROWS_FILE
Name of file with saving throw scores.
|
(package private) ArrayList<SavingThrows.SaveRecord> |
targetsTable
Table of saving throw targets.
|
Modifier | Constructor and Description |
---|---|
protected |
SavingThrows()
Constructor (read from dedicated file).
|
Modifier and Type | Method and Description |
---|---|
static SavingThrows |
getInstance()
Access the singleton class instance.
|
(package private) SavingThrows.SaveRecord |
getSaveRecord(String asClass,
int level)
Find the correct SaveRecord for this class/level.
|
int |
getSaveTarget(SavingThrows.SaveType saveType,
String asClass,
int level)
Get the target score for a saving throw.
|
static void |
main(String[] args)
Main test method.
|
boolean |
rollSave(SavingThrows.SaveType saveType,
String asClass,
int level)
Roll a saving throw without a modifier.
|
boolean |
rollSave(SavingThrows.SaveType saveType,
String asClass,
int level,
int modifier)
Roll a saving throw with a modifier.
|
final String SAVING_THROWS_FILE
static SavingThrows instance
ArrayList<SavingThrows.SaveRecord> targetsTable
protected SavingThrows() throws IOException
IOException
public static SavingThrows getInstance()
public boolean rollSave(SavingThrows.SaveType saveType, String asClass, int level, int modifier)
public boolean rollSave(SavingThrows.SaveType saveType, String asClass, int level)
public int getSaveTarget(SavingThrows.SaveType saveType, String asClass, int level)
SavingThrows.SaveRecord getSaveRecord(String asClass, int level)
public static void main(String[] args)