feat: implement 'grab' for Handful

This commit is contained in:
2025-11-16 08:11:43 +01:00
parent 11a6f4c592
commit 00b0463465
2 changed files with 9 additions and 3 deletions

View File

@@ -1,7 +1,11 @@
use crate::*;
impl Handful {
pub fn grab(dice: u16, sides: u16) -> Self {
todo!()
pub fn grab(dice_num: u16, sides: u16) -> Self {
let mut dice = Vec::<Die>::new();
for _ in 1..=dice_num {
dice.push(Die::new(sides));
}
Self { dice }
}
}

View File

@@ -1,7 +1,9 @@
use crate::*;
#[derive(Debug, Default, PartialEq, Clone)]
pub struct O {}
pub struct O {
pub(crate) dice: Vec<Die>,
}
// impl std::fmt::Display for O {
// fn fmt(&self, _f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {