use crate::prelude::*;
use beet_core::prelude::*;
#[derive(
Debug,
Default,
Copy,
Clone,
PartialEq,
Eq,
PartialOrd,
Ord,
Reflect,
EntityTargetEvent,
)]
pub struct GetOutcome;
impl RunEvent for GetOutcome {
type End = Outcome;
}
#[derive(
Debug,
Copy,
Clone,
PartialEq,
Eq,
PartialOrd,
Ord,
Reflect,
EntityTargetEvent,
)]
pub enum Outcome {
Pass,
Fail,
}
impl EndEvent for Outcome {
type Run = GetOutcome;
}
impl Outcome {
pub fn is_pass(&self) -> bool { self == &Outcome::Pass }
pub fn is_fail(&self) -> bool { self == &Outcome::Fail }
}
impl std::fmt::Display for Outcome {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Outcome::Pass => write!(f, "Pass"),
Outcome::Fail => write!(f, "Fail"),
}
}
}