use crate::{Encounter, Log};
pub mod fractals;
#[macro_use]
pub mod helpers;
pub mod raids;
pub mod strikes;
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum Outcome {
Success,
Failure,
}
impl Outcome {
pub fn from_bool(b: bool) -> Option<Outcome> {
if b {
Some(Outcome::Success)
} else {
Some(Outcome::Failure)
}
}
}
pub trait Analyzer {
fn log(&self) -> &Log;
fn is_cm(&self) -> bool;
fn outcome(&self) -> Option<Outcome>;
}
pub fn for_log<'l>(log: &'l Log) -> Option<Box<dyn Analyzer + 'l>> {
let boss = log.encounter()?;
match boss {
Encounter::ValeGuardian | Encounter::Gorseval | Encounter::Sabetha => {
Some(Box::new(raids::GenericRaid::new(log)))
}
Encounter::Slothasor | Encounter::BanditTrio | Encounter::Matthias => {
Some(Box::new(raids::GenericRaid::new(log)))
}
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))),
Encounter::MursaatOverseer => Some(Box::new(raids::MursaatOverseer::new(log))),
Encounter::Samarog => Some(Box::new(raids::Samarog::new(log))),
Encounter::Deimos => Some(Box::new(raids::Deimos::new(log))),
Encounter::SoullessHorror => Some(Box::new(raids::SoullessHorror::new(log))),
Encounter::RiverOfSouls => Some(Box::new(raids::RiverOfSouls::new(log))),
Encounter::BrokenKing | Encounter::EaterOfSouls | Encounter::StatueOfDarkness => {
Some(Box::new(raids::GenericRaid::new(log)))
}
Encounter::VoiceInTheVoid => Some(Box::new(raids::Dhuum::new(log))),
Encounter::ConjuredAmalgamate => Some(Box::new(raids::ConjuredAmalgamate::new(log))),
Encounter::TwinLargos => Some(Box::new(raids::TwinLargos::new(log))),
Encounter::Qadim => Some(Box::new(raids::Qadim::new(log))),
Encounter::CardinalAdina => Some(Box::new(raids::CardinalAdina::new(log))),
Encounter::CardinalSabir => Some(Box::new(raids::CardinalSabir::new(log))),
Encounter::QadimThePeerless => Some(Box::new(raids::QadimThePeerless::new(log))),
Encounter::StandardKittyGolem
| Encounter::MediumKittyGolem
| Encounter::LargeKittyGolem => Some(Box::new(raids::GenericRaid::new(log))),
Encounter::Ai => Some(Box::new(fractals::Ai::new(log))),
Encounter::Skorvald => Some(Box::new(fractals::Skorvald::new(log))),
Encounter::Artsariiv
| Encounter::Arkk
| Encounter::MAMA
| Encounter::Siax
| Encounter::Ensolyss => Some(Box::new(fractals::GenericFractal::new(log))),
Encounter::IcebroodConstruct
| Encounter::SuperKodanBrothers
| Encounter::FraenirOfJormag
| Encounter::Boneskinner
| Encounter::WhisperOfJormag => Some(Box::new(strikes::GenericStrike::new(log))),
Encounter::CaptainMaiTrin => Some(Box::new(strikes::CaptainMaiTrin::new(log))),
Encounter::Ankka => Some(Box::new(strikes::Ankka::new(log))),
Encounter::MinisterLi => Some(Box::new(strikes::MinisterLi::new(log))),
Encounter::Dragonvoid => Some(Box::new(strikes::Dragonvoid::new(log))),
}
}