[−][src]Struct destiny::DiceDistribution
A struct used to hold the information about a dice distribution.
Examples
use destiny::DiceDistribution; let dd = DiceDistribution::new("1d4"); assert_eq!(vec![1, 2, 3, 4], dd.possible_rolls);
Fields
dice_string: String
possible_rolls: Vec<i64>
distribution: HashMap<i64, i64>
roll_percentages: HashMap<i64, f64>
roll_over: HashMap<i64, f64>
roll_under: HashMap<i64, f64>
Methods
impl DiceDistribution
[src]
pub fn new(dice_string: &str) -> DiceDistribution
[src]
Creates a new DiceDistribution. This uses the supplied string to calculate the possible rolls, the distrribution of those rolls and the percentage chance to roll any particular value.
pub fn table(&self) -> Table
[src]
Creates a prettytable::Table containing a representation of self.
pub fn ptable(&self)
[src]
Creates and prints to stdout a table representation of self.
Auto Trait Implementations
impl Send for DiceDistribution
impl Sync for DiceDistribution
impl Unpin for DiceDistribution
impl UnwindSafe for DiceDistribution
impl RefUnwindSafe for DiceDistribution
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,