mirror of
https://github.com/eigenein/wotbreplay-parser.git
synced 2026-11-05 16:40:33 +01:00
New: extract Replay::read_battle_results_dat
This commit is contained in:
1 parent
805a2af81b
commit
be4a6c21b5
1 file changed
+6
-1
+6
-1
@@ -19,10 +19,15 @@ impl<R: Read + Seek> Replay<R> {
|
|||||||
|
|
||||||
/// Reads and parses the battle results from the replay.
|
/// Reads and parses the battle results from the replay.
|
||||||
pub fn read_battle_results(&mut self) -> Result<BattleResults> {
|
pub fn read_battle_results(&mut self) -> Result<BattleResults> {
|
||||||
|
self.read_battle_results_dat()?.decode_battle_results()
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Reads and parses the included `battle_results.dat`.
|
||||||
|
pub fn read_battle_results_dat(&mut self) -> Result<BattleResultsDat> {
|
||||||
let pickled_battle_results = self
|
let pickled_battle_results = self
|
||||||
.0
|
.0
|
||||||
.by_name("battle_results.dat")
|
.by_name("battle_results.dat")
|
||||||
.map_err(Error::OpenBattleResultsFailed)?;
|
.map_err(Error::OpenBattleResultsFailed)?;
|
||||||
BattleResultsDat::from_reader(pickled_battle_results)?.decode_battle_results()
|
BattleResultsDat::from_reader(pickled_battle_results)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user