pub fn roll(roll_type: RollType, rng: &mut impl Rng) -> Vec<Roll>Expand description
Rolls dice as described by roll_type, using rng for randomness.
Returns one Roll for normal and critical rolls, two for advantage
and disadvantage, and six for ability scores.
ยงExamples
use rust_roll::notation::Notation;
use rust_roll::roller::{roll, RollType};
let notation: Notation = "2d6".parse().unwrap();
let rolls = roll(RollType::Normal(notation), &mut rand::rng());
assert_eq!(rolls.len(), 1);
assert_eq!(rolls[0].dice.len(), 2);