pub struct Max;Expand description
Generates rolls that always have their max value.
§Examples
use tyche::dice::{roller::{Max as MaxRoller, Roller}, Dice};
let mut roller = MaxRoller;
let dice = Dice::new(4, 6);
let rolled = roller.roll(&dice, true)?;
assert!(rolled.rolls.iter().all(|roll| roll.val == 6));
let dice = Dice::new(2, 20);
let rolled = roller.roll(&dice, true)?;
assert!(rolled.rolls.iter().all(|roll| roll.val == 20));Trait Implementations§
Auto Trait Implementations§
impl Freeze for Max
impl RefUnwindSafe for Max
impl Send for Max
impl Sync for Max
impl Unpin for Max
impl UnwindSafe for Max
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more