summaryrefslogtreecommitdiff
path: root/src/dice.rs
diff options
context:
space:
mode:
authorDavid Gay <eapoems@riseup.net>2023-10-01 02:34:16 -0400
committerDavid Gay <eapoems@riseup.net>2023-10-01 02:34:16 -0400
commitb77f46d0146d6b5b9acdb23546db2d57c37ed2af (patch)
treead13966380074bd581ce9efac956f65a38393095 /src/dice.rs
parent8bc79457594a01f22f7146d3e1855de54558c531 (diff)
Draft of random tables
Diffstat (limited to 'src/dice.rs')
-rw-r--r--src/dice.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dice.rs b/src/dice.rs
index ffec3b8..64a4635 100644
--- a/src/dice.rs
+++ b/src/dice.rs
@@ -21,7 +21,7 @@ pub struct RollResult {
}
impl RollResult {
- fn new() -> Self {
+ pub fn new() -> Self {
RollResult {
rolls: Vec::new(),
}
@@ -31,7 +31,7 @@ impl RollResult {
self.rolls.push(roll)
}
- fn total(&self) -> u32 {
+ pub fn total(&self) -> u32 {
self.rolls.iter().map(|die_roll| die_roll.face).sum()
}
}