use std::time::Instant;
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct Outcome {
won: bool,
end: Instant,
}
impl Outcome {
#[must_use]
pub(crate) fn new(won: bool) -> Self {
Self {
won,
end: Instant::now(),
}
}
#[must_use]
pub(crate) fn won() -> Self {
Self::new(true)
}
#[must_use]
pub(crate) fn lost() -> Self {
Self::new(false)
}
#[must_use]
pub const fn is_won(self) -> bool {
self.won
}
#[must_use]
pub const fn end(self) -> Instant {
self.end
}
}