aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-09-28 13:37:49 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-09-28 13:37:49 +0200
commit52deb7c4a8ed0a3714abe10c6d532e34f784f86c (patch)
treec19dc57913b6644a5dfa484387205b963271a7a6
parentb50febe63e8d72b396feac4b67f55fbc52c03dae (diff)
downloadevtclib-52deb7c4a8ed0a3714abe10c6d532e34f784f86c.tar.gz
evtclib-52deb7c4a8ed0a3714abe10c6d532e34f784f86c.tar.bz2
evtclib-52deb7c4a8ed0a3714abe10c6d532e34f784f86c.zip
add Log::build_id
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/lib.rs12
2 files changed, 13 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dfbd25d..645f723 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
- `analyzers::fractal::Ai` with logic to determine CM and outcome of the
Sunqua Peak CM fight.
- `Log::gadgets` to retrieve all gadget agents.
+- `Log::build_id` to retrieve the game's build id.
### Changed
- `gamedata::Boss` has been split in `gamedata::Boss` and `gamedata::Encounter`
diff --git a/src/lib.rs b/src/lib.rs
index 9e605d8..60b404c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -915,4 +915,16 @@ impl Log {
})
.collect()
}
+
+ /// Returns the game's build id.
+ ///
+ /// If no build id was found, `None` is returned.
+ pub fn build_id(&self) -> Option<u64> {
+ for event in self.events() {
+ if let EventKind::Build { build } = event.kind() {
+ return Some(*build)
+ }
+ }
+ None
+ }
}