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
()
| 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 |
no test coverage detected