subtr-actor 1.0.0

Rocket League replay transformer
Documentation
use crate::*;

use super::*;

impl StatFieldProvider for RotationPlayerStats {
    fn visit_stat_fields(&self, visitor: &mut dyn FnMut(ExportedStat)) {
        visitor(ExportedStat::float(
            "rotation",
            "active_game_time",
            StatUnit::Seconds,
            self.active_game_time,
        ));
        visitor(ExportedStat::float(
            "rotation",
            "time_first_man",
            StatUnit::Seconds,
            self.time_first_man,
        ));
        visitor(ExportedStat::float(
            "rotation",
            "time_second_man",
            StatUnit::Seconds,
            self.time_second_man,
        ));
        visitor(ExportedStat::float(
            "rotation",
            "time_third_man",
            StatUnit::Seconds,
            self.time_third_man,
        ));
        visitor(ExportedStat::float(
            "rotation",
            "time_ambiguous_role",
            StatUnit::Seconds,
            self.time_ambiguous_role,
        ));
        visitor(ExportedStat::float(
            "rotation",
            "percent_first_man",
            StatUnit::Percent,
            self.first_man_pct(),
        ));
        visitor(ExportedStat::float(
            "rotation",
            "percent_second_man",
            StatUnit::Percent,
            self.second_man_pct(),
        ));
        visitor(ExportedStat::float(
            "rotation",
            "percent_third_man",
            StatUnit::Percent,
            self.third_man_pct(),
        ));
        visitor(ExportedStat::float(
            "rotation",
            "percent_ambiguous_role",
            StatUnit::Percent,
            self.ambiguous_role_pct(),
        ));
        visitor(ExportedStat::unsigned(
            "rotation",
            "first_man_stints",
            StatUnit::Count,
            self.first_man_stint_count,
        ));
        visitor(ExportedStat::float(
            "rotation",
            "longest_first_man_stint_time",
            StatUnit::Seconds,
            self.longest_first_man_stint_time,
        ));
        visitor(ExportedStat::float(
            "rotation",
            "avg_first_man_stint_time",
            StatUnit::Seconds,
            self.average_first_man_stint_time(),
        ));
        visitor(ExportedStat::unsigned(
            "rotation",
            "became_first_man",
            StatUnit::Count,
            self.became_first_man_count,
        ));
        visitor(ExportedStat::unsigned(
            "rotation",
            "lost_first_man",
            StatUnit::Count,
            self.lost_first_man_count,
        ));
    }
}

impl StatFieldProvider for RotationTeamStats {
    fn visit_stat_fields(&self, visitor: &mut dyn FnMut(ExportedStat)) {
        visitor(ExportedStat::unsigned(
            "rotation",
            "first_man_changes_for_team",
            StatUnit::Count,
            self.first_man_changes_for_team,
        ));
        visitor(ExportedStat::unsigned(
            "rotation",
            "rotation_count",
            StatUnit::Count,
            self.rotation_count,
        ));
    }
}