pub struct Outcome {
pub prob: f64,
pub atk_hp: u32,
pub def_hp: u32,
}
Expand description
The outcome of combat, with associated probability.
Fields§
§prob: f64
§atk_hp: u32
§def_hp: u32
Implementations§
Source§impl Outcome
impl Outcome
Sourcepub fn collect(outcomes: Vec<Outcome>) -> Vec<Outcome>
pub fn collect(outcomes: Vec<Outcome>) -> Vec<Outcome>
Combines the probabilities of identical outcomes in the list of outcomes and removes impossible outcomes, returning a new list with the same total probabilities.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Outcome
impl<'de> Deserialize<'de> for Outcome
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Outcome
impl StructuralPartialEq for Outcome
Auto Trait Implementations§
impl Freeze for Outcome
impl RefUnwindSafe for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnwindSafe for Outcome
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more