Struct dice::Dice
[−]
[src]
pub struct Dice(_, _);
A set of same-sized dice.
Methods
impl Dice
[src]
fn minimum(&self, fold: Fold) -> i32
Returns the smallest possible result of rolling this set of dice.
fn maximum(&self, fold: Fold) -> i32
Returns the largest possible result of rolling this set of dice.
fn average(&self, reroll: Option<Reroll>, fold: Fold) -> Ratio
Returns the average result of rolling this set of dice.
fn results(&self, fold: Fold) -> impl Iterator<Item = i32>
Returns all the possible results of rolling this set of dice.
fn probabilities(&self, reroll: Option<Reroll>, fold: Fold) -> Vec<(i32, Ratio)>
Returns the probabilities of all the possible results of rolling this set of dice.
impl Dice
[src]
fn new(size: u32, die: Die) -> Self
fn size(&self) -> u32
Returns the size of this set of dice.
fn die(&self) -> Die
Returns the die used in this set of dice.
fn roll(&self, rng: &mut Rng, reroll: Option<Reroll>, fold: Fold) -> DiceResult
Rolls this set of dice and returns the combined result.
Trait Implementations
impl Copy for Dice
[src]
impl Clone for Dice
[src]
fn clone(&self) -> Dice
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Dice
[src]
impl PartialEq for Dice
[src]
fn eq(&self, __arg_0: &Dice) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Dice) -> bool
This method tests for !=
.