MCPcopy Create free account
hub / github.com/PCGen/pcgen / getNext

Method getNext

code/src/java/pcgen/cdom/content/HitDie.java:84–108  ·  view source on GitHub ↗

Returns the next (i.e. next larger) HitDie in the globally defined sequence of Hit Dice. The behavior of this method is not defined if the HitDie on which this method is called is not in the globally defined sequence of Hit Dice. If this is the largest HitDie in the globally defined sequence of Hi

()

Source from the content-addressed store, hash-verified

82 * @return the next HitDie in the globally defined sequence of Hit Dice.
83 */
84 public HitDie getNext()
85 {
86 int[] dieSizes = SettingsHandler.getGameAsProperty().get().getDieSizes();
87 int length = dieSizes.length;
88 for (int i = 0; i < length; ++i)
89 {
90 if (die == dieSizes[i])
91 {
92 if (i == length - 1)
93 {
94 if (Logging.isDebugMode())
95 {
96 Logging.debugPrint("Hit Die: " + die + " is Highest Hit Die in Die Sizes");
97 }
98 return this;
99 }
100 else
101 {
102 return new HitDie(dieSizes[i + 1]);
103 }
104 }
105 }
106 Logging.errorPrint("Cannot find Hit Die: " + die + " in Global Die Sizes");
107 return this;
108 }
109
110 /**
111 * Returns the previous (i.e. next smaller) HitDie in the globally defined

Callers 1

applyProcessorMethod · 0.95

Calls 6

getGameAsPropertyMethod · 0.95
isDebugModeMethod · 0.95
debugPrintMethod · 0.95
errorPrintMethod · 0.95
getDieSizesMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected