From 5ae375078d981e9efb3ac6ea68572f941fc883cf Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 4 Oct 2020 11:48:26 +0200 Subject: update to newest evtclib There's a good chance that this will be evtclib 0.5, so we want to adapt our API usage (mainly replacing evtclib::Boss with evtclib::Encounter). The naming is a bit all over the place now, as we sometimes refer to bosses and sometimes to encounters, but I hope to make a sensible decision at *some point* about what we're actually doing here. --- src/filters/log.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/filters') 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; #[derive(Debug, Clone)] -struct BossFilter(HashSet); +struct BossFilter(HashSet); impl Filter 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) -> Box { +pub fn encounter(bosses: HashSet) -> Box { Box::new(BossFilter(bosses)) } -- cgit v1.2.3