From b77f46d0146d6b5b9acdb23546db2d57c37ed2af Mon Sep 17 00:00:00 2001 From: David Gay Date: Sun, 1 Oct 2023 02:34:16 -0400 Subject: Draft of random tables --- src/dice.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dice.rs') 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() } } -- cgit v1.2.3