Enum d20::DieRollTerm
[−]
[src]
pub enum DieRollTerm { DieRoll { multiplier: i8, sides: u8, }, Modifier(i8), }
Represents an individual term within a die roll expression. Terms can either be numeric
modifiers like +5
or -2
or they can be terms indicating die rolls.
Variants
DieRoll
Indicates a die roll term to roll multiplier
dice with sides
sides.
Fields of DieRoll
multiplier: i8 | Number of times to roll the given die |
sides: u8 | Number of sides on the given die |
Modifier(i8)
Numeric modifier used in simple left-to-right numeric evaluation of a die roll expression.
Trait Implementations
impl Debug for DieRollTerm
[src]
impl Clone for DieRollTerm
[src]
fn clone(&self) -> DieRollTerm
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 Display for DieRollTerm
[src]
Formats an individual die roll term in a human-friendly fashion. For Modifier
terms,
this will force the printing of a + or - sign before the modifier value. For DieRoll
terms, this displays the term in the form 5d10
.