diff options
author | Daniel Schadt <kingdread@gmx.de> | 2020-09-23 15:22:55 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2020-09-23 15:23:55 +0200 |
commit | 39972d54be41bfc7b8b7f38b1f5a4d60e2453da5 (patch) | |
tree | 5ef048c306eca6a67005290859a29699d35978b6 /src/lib.rs | |
parent | 3b79ad8fa9b4a8c9c535b417129e3f70769074e0 (diff) | |
download | evtclib-39972d54be41bfc7b8b7f38b1f5a4d60e2453da5.tar.gz evtclib-39972d54be41bfc7b8b7f38b1f5a4d60e2453da5.tar.bz2 evtclib-39972d54be41bfc7b8b7f38b1f5a4d60e2453da5.zip |
rename Boss to Encounter
This is the first step in differentiating between Encounters and Bosses.
It sounds a bit weird at first, but there are some events without any
bosses (like the River of Souls), and some events which have multiple
bosses (like Twin Largos or the kodan strike mission). If we want to
support this better, without relying on extra IDs, special casing and
constants (like NIKARE_ID), we should differentiate between Encounters
and Bosses.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -104,7 +104,7 @@ mod processing; pub use processing::{process, process_file, process_stream, Compression}; pub mod gamedata; -pub use gamedata::{Boss, EliteSpec, Profession}; +pub use gamedata::{EliteSpec, Encounter, Profession}; pub mod analyzers; pub use analyzers::{Analyzer, Outcome}; @@ -758,11 +758,11 @@ impl Log { /// This correctly returns multiple agents on encounters where multiple /// agents are needed. pub fn boss_agents(&self) -> Vec<&Agent> { - let boss_ids = if self.boss_id == Boss::Xera as u16 { + let boss_ids = if self.boss_id == Encounter::Xera as u16 { vec![self.boss_id, gamedata::XERA_PHASE2_ID] - } else if self.boss_id == Boss::LargosTwins as u16 { + } else if self.boss_id == Encounter::TwinLargos as u16 { vec![gamedata::NIKARE_ID, gamedata::KENUT_ID] - } else if self.encounter() == Some(Boss::VoiceOfTheFallen) { + } else if self.encounter() == Some(Encounter::SuperKodanBrothers) { vec![ gamedata::VOICE_OF_THE_FALLEN_ID, gamedata::CLAW_OF_THE_FALLEN_ID, @@ -791,16 +791,16 @@ impl Log { /// /// Some logs don't have an encounter set or have an ID that is unknown to us (for example, if /// people set up arcdps with custom IDs). Therefore, this method can only return the encounter - /// if we know about it in [`Boss`][Boss]. + /// if we know about it in [`Encounter`]. #[inline] - pub fn encounter(&self) -> Option<Boss> { + pub fn encounter(&self) -> Option<Encounter> { // Sometimes, encounters of the strike mission "Voice of the Fallen and Claw of the Fallen" // are saved with the ID of the Claw and sometimes with the Voice. Therefore, we need to // unify those cases. if self.boss_id == gamedata::CLAW_OF_THE_FALLEN_ID { - return Some(Boss::VoiceOfTheFallen); + return Some(Encounter::SuperKodanBrothers); } - Boss::from_u16(self.boss_id) + Encounter::from_u16(self.boss_id) } /// Return an analyzer suitable to analyze the given log. |