feat: add method roll to Handful
This commit is contained in:
14
01.workspace/oxidice_lib/src/imp/handful_roll.rs
Normal file
14
01.workspace/oxidice_lib/src/imp/handful_roll.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use crate::*;
|
||||
|
||||
impl Handful {
|
||||
pub fn roll(self) -> Outcome {
|
||||
let mut die_rolls = Vec::<u16>::new();
|
||||
for die in self.dice {
|
||||
die_rolls.push(die.roll());
|
||||
}
|
||||
Outcome::List(die_rolls)
|
||||
}
|
||||
}
|
||||
|
||||
// #[cfg(test)]
|
||||
// mod unit_tests { use super::*; }
|
||||
@@ -1,3 +1,4 @@
|
||||
pub mod die_new;
|
||||
pub mod die_roll;
|
||||
pub mod handful_grab;
|
||||
pub mod handful_roll;
|
||||
|
||||
Reference in New Issue
Block a user