From d64ead757122e713d2cbb133d5fe683537cfcf6c Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 23 Jul 2020 17:33:15 +0200 Subject: implement Analyzer::outcome for fractals --- src/analyzers/fractals.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/analyzers/fractals.rs b/src/analyzers/fractals.rs index dd010ac..e3ebfc5 100644 --- a/src/analyzers/fractals.rs +++ b/src/analyzers/fractals.rs @@ -1,6 +1,6 @@ //! Analyzers for (challenge mote) fractal encounters. use crate::{ - analyzers::{helpers, Analyzer}, + analyzers::{helpers, Analyzer, Outcome}, Log, }; @@ -30,6 +30,10 @@ impl<'log> Analyzer for Skorvald<'log> { .map(|h| h >= SKORVALD_CM_HEALTH) .unwrap_or(false) } + + fn outcome(&self) -> Option { + Outcome::from_bool(self.log.was_rewarded() || helpers::boss_is_dead(self.log)) + } } #[derive(Debug, Clone, Copy)] @@ -51,4 +55,8 @@ impl<'log> Analyzer for GenericFractal<'log> { fn is_cm(&self) -> bool { true } + + fn outcome(&self) -> Option { + Outcome::from_bool(self.log.was_rewarded() || helpers::boss_is_dead(self.log)) + } } -- cgit v1.2.3