aboutsummaryrefslogtreecommitdiff
path: root/src/filters
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2020-10-04 11:48:26 +0200
committerDaniel <kingdread@gmx.de>2020-10-04 11:48:26 +0200
commit5ae375078d981e9efb3ac6ea68572f941fc883cf (patch)
tree6718d823ec6c08a67b665a31fb0ee8396aa651f6 /src/filters
parent16a3472627e421488ec461447301a39fcca1d4ef (diff)
downloadraidgrep-5ae375078d981e9efb3ac6ea68572f941fc883cf.tar.gz
raidgrep-5ae375078d981e9efb3ac6ea68572f941fc883cf.tar.bz2
raidgrep-5ae375078d981e9efb3ac6ea68572f941fc883cf.zip
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.
Diffstat (limited to 'src/filters')
-rw-r--r--src/filters/log.rs10
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))
}