[−][src]Struct critfail::CheckOutcome
The outcome of a check roll.
This struct is normally constructed as the result of calling
roll()
on a Check
roll expression.
use critfail::{RollExpression, Check, CheckOutcome}; let outcome: CheckOutcome = Check::new("r+1").unwrap().roll();
Implementations
impl CheckOutcome
[src]
pub fn score(&self) -> Score
[src]
Get the score of a CheckOutcome
.
This is the plain numerical score of a roll, without accounting for critial success/failure
use critfail::CheckOutcomeBuilder; // (20)+4 let critical = CheckOutcomeBuilder::new() .check(20) .modifier(4) .build(); // (16)+4 let normal = CheckOutcomeBuilder::new() .check(16) .modifier(4) .build(); // (1)+4 let fail = CheckOutcomeBuilder::new() .check(1) .modifier(4) .build(); assert_eq!(critical.score(), 24); assert_eq!(normal.score(), 20); assert_eq!(fail.score(), 5);
pub fn crit_score(&self) -> CritScore
[src]
Get the score of a CheckOutcome
that could be a critical success/failure.
use critfail::{CheckOutcomeBuilder, CritScore}; // (20)+4 let critical = CheckOutcomeBuilder::new() .check(20) .modifier(4) .build(); // (16)+4 let normal = CheckOutcomeBuilder::new() .check(16) .modifier(4) .build(); // (1)+4 let fail = CheckOutcomeBuilder::new() .check(1) .modifier(4) .build(); assert_eq!(critical.crit_score(), CritScore::Critical); assert_eq!(normal.crit_score(), CritScore::Normal(20)); assert_eq!(fail.crit_score(), CritScore::Fail);
Trait Implementations
impl Clone for CheckOutcome
[src]
fn clone(&self) -> CheckOutcome
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for CheckOutcome
[src]
impl Display for CheckOutcome
[src]
impl From<CheckOutcome> for RollOutcome
[src]
fn from(o: CheckOutcome) -> Self
[src]
impl PartialEq<CheckOutcome> for CheckOutcome
[src]
fn eq(&self, other: &CheckOutcome) -> bool
[src]
fn ne(&self, other: &CheckOutcome) -> bool
[src]
impl StructuralPartialEq for CheckOutcome
[src]
Auto Trait Implementations
impl RefUnwindSafe for CheckOutcome
impl Send for CheckOutcome
impl Sync for CheckOutcome
impl Unpin for CheckOutcome
impl UnwindSafe for CheckOutcome
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,