aboutsummaryrefslogtreecommitdiff
path: root/src/filters.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/filters.rs')
-rw-r--r--src/filters.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/filters.rs b/src/filters.rs
index 8433690..02334bc 100644
--- a/src/filters.rs
+++ b/src/filters.rs
@@ -1,5 +1,8 @@
use evtclib::{Agent, AgentName};
use evtclib::raw::parser::PartialEvtc;
+use evtclib::statistics::gamedata::Boss;
+
+use num_traits::FromPrimitive;
use super::{SearchField, LogResult, Opt};
@@ -30,6 +33,14 @@ pub fn filter_name(evtc: &PartialEvtc, opt: &Opt) -> bool {
false
}
+/// Do filtering based on the boss ID.
+pub fn filter_boss(evtc: &PartialEvtc, opt: &Opt) -> bool {
+ let boss = Boss::from_u16(evtc.header.combat_id);
+ boss
+ .map(|b| opt.bosses.contains(&b))
+ .unwrap_or(true)
+}
+
/// Do filtering based on the fight outcome.
pub fn filter_outcome(result: &LogResult, opt: &Opt) -> bool {
opt.outcome.contains(&result.outcome)