aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-09-23 15:40:52 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-09-23 15:41:53 +0200
commit14b6a38e61b2e7b6d3d21a350283b3ec60a757ea (patch)
tree82fbd90bfe224ecdd8e806147006ba63550d05b5 /src/lib.rs
parent39972d54be41bfc7b8b7f38b1f5a4d60e2453da5 (diff)
downloadevtclib-14b6a38e61b2e7b6d3d21a350283b3ec60a757ea.tar.gz
evtclib-14b6a38e61b2e7b6d3d21a350283b3ec60a757ea.tar.bz2
evtclib-14b6a38e61b2e7b6d3d21a350283b3ec60a757ea.zip
re-introduce Boss
This is now the enum that contains the IDs of the single bosses, like Nikare and Kenut. This means we can do away with the NIKARE_ID and such. The enum is not publicly re-exported, as we re-export Encounter (which is more of a replacement of the old Boss). Special casing still remains (mostly in lib.rs), but we should be able to do away with this now with a more general Encounter::bosses and Boss::encounter methods.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 75bf313..764f8ce 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -104,6 +104,7 @@ mod processing;
pub use processing::{process, process_file, process_stream, Compression};
pub mod gamedata;
+use gamedata::Boss;
pub use gamedata::{EliteSpec, Encounter, Profession};
pub mod analyzers;
@@ -759,14 +760,11 @@ impl Log {
/// agents are needed.
pub fn boss_agents(&self) -> Vec<&Agent> {
let boss_ids = if self.boss_id == Encounter::Xera as u16 {
- vec![self.boss_id, gamedata::XERA_PHASE2_ID]
+ vec![self.boss_id, Boss::Xera2 as u16]
} else if self.boss_id == Encounter::TwinLargos as u16 {
- vec![gamedata::NIKARE_ID, gamedata::KENUT_ID]
+ vec![Boss::Nikare as u16, Boss::Kenut as u16]
} else if self.encounter() == Some(Encounter::SuperKodanBrothers) {
- vec![
- gamedata::VOICE_OF_THE_FALLEN_ID,
- gamedata::CLAW_OF_THE_FALLEN_ID,
- ]
+ vec![Boss::VoiceOfTheFallen as u16, Boss::ClawOfTheFallen as u16]
} else {
vec![self.boss_id]
};
@@ -797,7 +795,7 @@ impl Log {
// 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 {
+ if self.boss_id == Boss::ClawOfTheFallen as u16 {
return Some(Encounter::SuperKodanBrothers);
}
Encounter::from_u16(self.boss_id)