aboutsummaryrefslogtreecommitdiff
path: root/src/analyzers/raids/mod.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-07-23 02:47:52 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-07-23 02:47:52 +0200
commit962e2b9f8e17a50c7d7d37a424591b0df62f265c (patch)
tree61efe53eae3768aca9d5ce1eb89c91f5adaceeba /src/analyzers/raids/mod.rs
parent0978345648cf9cdad6222f583dd21497b409d07e (diff)
downloadevtclib-962e2b9f8e17a50c7d7d37a424591b0df62f265c.tar.gz
evtclib-962e2b9f8e17a50c7d7d37a424591b0df62f265c.tar.bz2
evtclib-962e2b9f8e17a50c7d7d37a424591b0df62f265c.zip
implement proper outcome for w1-w4
It turns out that `was_rewarded` is a pretty bad heuristic if you ever kill a boss a second time per week (basically, was_rewarded=false does not imply that the boss was unsuccessful). Therefore, we need a proper detection of when a fight failed and when a fight succeeded. This is the first batch that implements this as part of the Analyzer trait for bosses of wings 1 to 4.
Diffstat (limited to 'src/analyzers/raids/mod.rs')
-rw-r--r--src/analyzers/raids/mod.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/analyzers/raids/mod.rs b/src/analyzers/raids/mod.rs
index 91b0dba..33d54ce 100644
--- a/src/analyzers/raids/mod.rs
+++ b/src/analyzers/raids/mod.rs
@@ -1,3 +1,11 @@
+use crate::{
+ analyzers::{helpers, Analyzer, Outcome},
+ Log,
+};
+
+mod w3;
+pub use w3::Xera;
+
mod w4;
pub use w4::{Cairn, Deimos, MursaatOverseer, Samarog};
@@ -9,3 +17,29 @@ pub use w6::{ConjuredAmalgamate, LargosTwins, Qadim};
mod w7;
pub use w7::{CardinalAdina, CardinalSabir, QadimThePeerless};
+
+/// A generic raid analyzer that works for bosses without special interactions.
+#[derive(Debug, Clone, Copy)]
+pub struct GenericRaid<'log> {
+ log: &'log Log,
+}
+
+impl<'log> GenericRaid<'log> {
+ pub fn new(log: &'log Log) -> Self {
+ GenericRaid { log }
+ }
+}
+
+impl<'log> Analyzer for GenericRaid<'log> {
+ fn log(&self) -> &Log {
+ self.log
+ }
+
+ fn is_cm(&self) -> bool {
+ false
+ }
+
+ fn outcome(&self) -> Option<Outcome> {
+ Outcome::from_bool(helpers::boss_is_dead(self.log))
+ }
+}