diff options
Diffstat (limited to 'src/filters')
-rw-r--r-- | src/filters/log.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/filters/log.rs b/src/filters/log.rs index 10258a0..bd02b21 100644 --- a/src/filters/log.rs +++ b/src/filters/log.rs @@ -9,7 +9,7 @@ use super::{ use std::collections::HashSet; -use evtclib::Boss; +use evtclib::Encounter; use chrono::{DateTime, Datelike, Utc, Weekday}; use num_traits::FromPrimitive as _; @@ -18,22 +18,22 @@ use num_traits::FromPrimitive as _; pub trait LogFilter = Filter<EarlyLogResult, LogResult>; #[derive(Debug, Clone)] -struct BossFilter(HashSet<Boss>); +struct BossFilter(HashSet<Encounter>); impl Filter<EarlyLogResult, LogResult> for BossFilter { fn filter_early(&self, early_log: &EarlyLogResult) -> Inclusion { - let boss = Boss::from_u16(early_log.evtc.header.combat_id); + let boss = Encounter::from_u16(early_log.evtc.header.combat_id); boss.map(|b| self.0.contains(&b).into()) .unwrap_or(Inclusion::Exclude) } fn filter(&self, log: &LogResult) -> bool { - log.boss.map(|b| self.0.contains(&b)).unwrap_or(false) + log.encounter.map(|b| self.0.contains(&b)).unwrap_or(false) } } /// A `LogFilter` that only accepts logs with one of the given bosses. -pub fn boss(bosses: HashSet<Boss>) -> Box<dyn LogFilter> { +pub fn encounter(bosses: HashSet<Encounter>) -> Box<dyn LogFilter> { Box::new(BossFilter(bosses)) } |