aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-04-28 12:21:28 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-04-28 12:21:28 +0200
commit84cba68af3d58573aba22b132ed4c3a1c5ccfaec (patch)
tree10f7772ceff62646ff9a35c9cf5b320318e3f62d
parent134c9eb670095210672ec125c2df755fe7ec341e (diff)
downloadevtclib-84cba68af3d58573aba22b132ed4c3a1c5ccfaec.tar.gz
evtclib-84cba68af3d58573aba22b132ed4c3a1c5ccfaec.tar.bz2
evtclib-84cba68af3d58573aba22b132ed4c3a1c5ccfaec.zip
move boss_id() to encounter_id(), add encounter()
-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