aboutsummaryrefslogtreecommitdiff
path: root/src/analyzers
diff options
context:
space:
mode:
Diffstat (limited to 'src/analyzers')
-rw-r--r--src/analyzers/mod.rs1
-rw-r--r--src/analyzers/raids/mod.rs2
-rw-r--r--src/analyzers/raids/w3.rs30
3 files changed, 32 insertions, 1 deletions
diff --git a/src/analyzers/mod.rs b/src/analyzers/mod.rs
index fcec7cf..1d8caf7 100644
--- a/src/analyzers/mod.rs
+++ b/src/analyzers/mod.rs
@@ -92,6 +92,7 @@ pub fn for_log<'l>(log: &'l Log) -> Option<Box<dyn Analyzer + 'l>> {
}
Encounter::KeepConstruct => Some(Box::new(raids::GenericRaid::new(log))),
+ Encounter::TwistedCastle => Some(Box::new(raids::TwistedCastle::new(log))),
Encounter::Xera => Some(Box::new(raids::Xera::new(log))),
Encounter::Cairn => Some(Box::new(raids::Cairn::new(log))),
diff --git a/src/analyzers/raids/mod.rs b/src/analyzers/raids/mod.rs
index 824b957..1e0f09e 100644
--- a/src/analyzers/raids/mod.rs
+++ b/src/analyzers/raids/mod.rs
@@ -10,7 +10,7 @@ use crate::{
};
mod w3;
-pub use w3::Xera;
+pub use w3::{TwistedCastle, Xera};
mod w4;
pub use w4::{Cairn, Deimos, MursaatOverseer, Samarog};
diff --git a/src/analyzers/raids/w3.rs b/src/analyzers/raids/w3.rs
index 16a3d13..e46457f 100644
--- a/src/analyzers/raids/w3.rs
+++ b/src/analyzers/raids/w3.rs
@@ -5,6 +5,36 @@ use crate::{
/// Analyzer for the final fight of Wing 3, Xera.
#[derive(Debug, Clone, Copy)]
+pub struct TwistedCastle<'log> {
+ log: &'log Log,
+}
+
+impl<'log> TwistedCastle<'log> {
+ /// Create a new [`TwistedCastle`] analyzer for the given log.
+ ///
+ /// **Do not** use this method unless you know what you are doing. Instead, rely on
+ /// [`Log::analyzer`]!
+ pub fn new(log: &'log Log) -> Self {
+ TwistedCastle { log }
+ }
+}
+
+impl<'log> Analyzer for TwistedCastle<'log> {
+ fn log(&self) -> &Log {
+ self.log
+ }
+
+ fn is_cm(&self) -> bool {
+ false
+ }
+
+ fn outcome(&self) -> Option<Outcome> {
+ Outcome::from_bool(self.log.was_rewarded())
+ }
+}
+
+/// Analyzer for the final fight of Wing 3, Xera.
+#[derive(Debug, Clone, Copy)]
pub struct Xera<'log> {
log: &'log Log,
}