aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b884b05..72b35ef 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -506,11 +506,20 @@ impl Log {
self.boss_agents().into_iter().any(|a| a.addr() == addr)
}
- /// Returns the boss/encounter id.
- pub fn boss_id(&self) -> u16 {
+ /// Returns the encounter id.
+ pub fn encounter_id(&self) -> u16 {
self.boss_id
}
+ /// Returns the encounter, if present.
+ ///
+ /// Some logs don't have an encounter set or have an ID that is unknown to us (for example, if
+ /// people set up arcdps with custom IDs). Therefore, this method can only return the encounter
+ /// if we know about it in [`Boss`][Boss].
+ pub fn encounter(&self) -> Option<Boss> {
+ Boss::from_u16(self.boss_id)
+ }
+
/// Return all events present in this log.
pub fn events(&self) -> &[Event] {
&self.events