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

Indicates a die roll term to roll multiplier dice with sides sides.

Fields of DieRoll

Number of times to roll the given die

Number of sides on the given die

Numeric modifier used in simple left-to-right numeric evaluation of a die roll expression.

Trait Implementations

impl Debug for DieRollTerm
[src]

Formats the value using the given formatter.

impl Clone for DieRollTerm
[src]

Returns a copy of the value. Read more

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.

Formats the value using the given formatter. Read more