diff options
author | Daniel Schadt <kingdread@gmx.de> | 2018-07-07 03:23:25 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2018-07-07 03:23:25 +0200 |
commit | 22051473844bddb60c8c062f511fd4b1f90d48bd (patch) | |
tree | 8001a9ff97ae7d065c2e6c56cf5fe5a98d44e6b4 /src/statistics/mod.rs | |
parent | 4ea1d4f3e5082925874a271d14cc143ebf80912f (diff) | |
download | evtclib-22051473844bddb60c8c062f511fd4b1f90d48bd.tar.gz evtclib-22051473844bddb60c8c062f511fd4b1f90d48bd.tar.bz2 evtclib-22051473844bddb60c8c062f511fd4b1f90d48bd.zip |
base for mechanic tracking
Diffstat (limited to 'src/statistics/mod.rs')
-rw-r--r-- | src/statistics/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/statistics/mod.rs b/src/statistics/mod.rs index a46fc27..f46f778 100644 --- a/src/statistics/mod.rs +++ b/src/statistics/mod.rs @@ -7,10 +7,12 @@ pub mod boon; pub mod damage; pub mod gamedata; pub mod math; +pub mod mechanics; pub mod trackers; use self::boon::BoonLog; use self::damage::DamageLog; +use self::mechanics::MechanicLog; use self::trackers::{RunnableTracker, Tracker}; pub type StatResult<T> = Result<T, StatError>; @@ -41,6 +43,8 @@ macro_rules! try_tracker { pub struct Statistics { /// The complete damage log. pub damage_log: DamageLog, + /// The complete mechanics log. + pub mechanic_log: MechanicLog, /// A map mapping agent addresses to their stats. pub agent_stats: HashMap<u64, AgentStats>, } @@ -90,6 +94,10 @@ pub fn calculate(log: &Log) -> StatResult<Statistics> { let mut combat_time_tracker = trackers::CombatTimeTracker::new(); let mut boon_tracker = trackers::BoonTracker::new(); + let mechanics = gamedata::get_mechanics(log.boss_id); + let boss_addr = log.boss_agents().into_iter().map(|x| *x.addr()).collect(); + let mut mechanic_tracker = trackers::MechanicTracker::new(boss_addr, mechanics); + run_trackers( log, &mut [ @@ -97,6 +105,7 @@ pub fn calculate(log: &Log) -> StatResult<Statistics> { &mut log_start_tracker, &mut combat_time_tracker, &mut boon_tracker, + &mut mechanic_tracker, ], )?; @@ -131,9 +140,11 @@ pub fn calculate(log: &Log) -> StatResult<Statistics> { } let damage_log = try_tracker!(damage_tracker.finalize()); + let mechanic_log = try_tracker!(mechanic_tracker.finalize()); Ok(Statistics { damage_log, + mechanic_log, agent_stats, }) } |