diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-02-21 15:40:30 -0500 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-02-21 15:40:30 -0500 |
| commit | 77a797089a2e065cc8cf2a83ae8356b16591aebe (patch) | |
| tree | e88f80b126cbb6de08881beb0a8c97111966a2b7 /BJC-Utils2/src/main/java/bjc/utils/dice/Die.java | |
| parent | d8b3b3c5e4441cecec98c06a36fc81570008c888 (diff) | |
Revamping of the way dice work
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/dice/Die.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/dice/Die.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/dice/Die.java b/BJC-Utils2/src/main/java/bjc/utils/dice/Die.java index 9998ae7..dc512b4 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/dice/Die.java +++ b/BJC-Utils2/src/main/java/bjc/utils/dice/Die.java @@ -2,15 +2,34 @@ package bjc.utils.dice; import java.util.Random; -public class Die { +/** + * A single polyhedral dice + * @author ben + * + */ +public class Die implements IDiceExpression { + /** + * Random # gen to use for dice + */ private static Random rng = new Random(); + /** + * Number of sides this die has + */ private int nSides; + /** + * Create a die with the specified number of sides + * @param nSides The number of sides this dice has + */ public Die(int nSides) { this.nSides = nSides; } + /** + * Roll this dice once + * @return The result of rolling the dice + */ public int roll() { return rng.nextInt(nSides + 1); } |
