From a166818ea312c83489d9397165bd16aa61fe5438 Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Tue, 6 Oct 2020 19:14:55 -0400 Subject: Info cleanup --- dice/src/main/java/bjc/dicelang/dicev2/Die.java | 27 ++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'dice/src/main/java/bjc/dicelang/dicev2/Die.java') diff --git a/dice/src/main/java/bjc/dicelang/dicev2/Die.java b/dice/src/main/java/bjc/dicelang/dicev2/Die.java index ab4f880..9fadb2d 100644 --- a/dice/src/main/java/bjc/dicelang/dicev2/Die.java +++ b/dice/src/main/java/bjc/dicelang/dicev2/Die.java @@ -4,25 +4,40 @@ import java.util.Random; /** * An abstract class that represents a single pool of dice. + * * @author Ben Culkin * */ public abstract class Die { private static final Random BASE = new Random(); + /** + * The RNG to use. + */ protected Random rng; + /** + * Create a new basic die. + */ protected Die() { rng = BASE; } + /** + * Create a new basic die. + * + * @param rnd + * The RNG to use. + */ protected Die(Random rnd) { rng = rnd; } /** * Set the RNG this die pool uses. - * @param rnd The RNG used by the die pool. + * + * @param rnd + * The RNG used by the die pool. */ public void setRandom(Random rnd) { rng = rnd; @@ -30,27 +45,33 @@ public abstract class Die { /** * Roll the entire die pool. + * * @return The results from rolling the dice. */ public abstract long[] roll(); + /** * Roll a single die in the pool. * * For pools with multiple die, this may be somewhat arbitrary. + * * @return Result from rolling a single die in the pool. */ - public abstract long rollSingle(); + public abstract long rollSingle(); /** * Can this pool be optimized? + * * @return Is the pool optimizable? */ public abstract boolean canOptimize(); + /** * Optimize the die pool. * * Is undefined if called while canOptimize is false. + * * @return The optimized version of the pool. */ - public abstract long optimize(); + public abstract long optimize(); } -- cgit v1.2.3