Struct parthia_lib::simple_calc::Outcome[][src]

pub struct Outcome {
    pub prob: f64,
    pub atk_hp: u32,
    pub def_hp: u32,
}

The outcome of combat, with associated probability.

Fields

prob: f64atk_hp: u32def_hp: u32

Implementations

impl Outcome[src]

pub fn collect(outcomes: Vec<Outcome>) -> Vec<Outcome>[src]

Combines the probabilities of identical outcomes in the list of outcomes and removes impossible outcomes, returning a new list with the same total probabilities.

pub fn add_into(&self, outcomes: Vec<Outcome>) -> Vec<Outcome>[src]

Adds the outcome to the list of outcomes, adding it to the probabliity of an existing outcome if it's identical.

pub fn switch(&self) -> Outcome[src]

Switches attacker and defender.

Trait Implementations

impl Clone for Outcome[src]

impl Copy for Outcome[src]

impl Debug for Outcome[src]

impl<'de> Deserialize<'de> for Outcome[src]

impl PartialEq<Outcome> for Outcome[src]

impl Serialize for Outcome[src]

impl StructuralPartialEq for Outcome[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.