From b50febe63e8d72b396feac4b67f55fbc52c03dae Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 28 Sep 2020 13:32:54 +0200 Subject: rename Log::npcs to Log::characters --- CHANGELOG.md | 1 + src/analyzers/fractals.rs | 2 +- src/lib.rs | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd8dd85..dfbd25d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file. `Boss::VoiceOfTheFallen` have been introduced - `gamedata::Boss` is no longer re-exported as `evtclib::Boss`, instead `evtclib::Encounter` is exported. +- Renamed `Log::npcs` to `Log::characters` to have consistent naming. ### Removed - Various `*_ID` constants from `gamedata`: `XERA_PHASE2_ID`, `NIKARE_ID`, diff --git a/src/analyzers/fractals.rs b/src/analyzers/fractals.rs index 69b7f17..5d4faf8 100644 --- a/src/analyzers/fractals.rs +++ b/src/analyzers/fractals.rs @@ -137,7 +137,7 @@ impl<'log> Analyzer for Skorvald<'log> { } self.log - .npcs() + .characters() .any(|character| SKORVALD_CM_ANOMALY_IDS.contains(&character.id())) } diff --git a/src/lib.rs b/src/lib.rs index cbfaf2e..9e605d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -738,8 +738,8 @@ impl Log { self.agents.iter().filter_map(|a| a.as_player()) } - /// Return an iterator over all agents that are NPCs. - pub fn npcs(&self) -> impl Iterator> { + /// Return an iterator over all agents that are characters. + pub fn characters(&self) -> impl Iterator> { self.agents.iter().filter_map(|a| a.as_character()) } @@ -753,7 +753,7 @@ impl Log { /// Be careful with encounters that have multiple boss agents, such as Trio /// and Xera. pub fn boss(&self) -> &Agent { - self.npcs() + self.characters() .find(|c| c.character().id == self.boss_id) .map(Agent::erase) .expect("Boss has no agent!") @@ -768,7 +768,7 @@ impl Log { .encounter() .map(Encounter::bosses) .unwrap_or(&[] as &[_]); - self.npcs() + self.characters() .filter(|c| bosses.iter().any(|boss| *boss as u16 == c.character().id)) .map(Agent::erase) .collect() -- cgit v1.2.3