subtr_actor/stats/export/
rotation.rs1use crate::*;
2
3use super::*;
4
5impl StatFieldProvider for RotationPlayerStats {
6 fn visit_stat_fields(&self, visitor: &mut dyn FnMut(ExportedStat)) {
7 visitor(ExportedStat::float(
8 "rotation",
9 "active_game_time",
10 StatUnit::Seconds,
11 self.active_game_time,
12 ));
13 visitor(ExportedStat::float(
14 "rotation",
15 "time_first_man",
16 StatUnit::Seconds,
17 self.time_first_man,
18 ));
19 visitor(ExportedStat::float(
20 "rotation",
21 "time_second_man",
22 StatUnit::Seconds,
23 self.time_second_man,
24 ));
25 visitor(ExportedStat::float(
26 "rotation",
27 "time_third_man",
28 StatUnit::Seconds,
29 self.time_third_man,
30 ));
31 visitor(ExportedStat::float(
32 "rotation",
33 "time_ambiguous_role",
34 StatUnit::Seconds,
35 self.time_ambiguous_role,
36 ));
37 visitor(ExportedStat::float(
38 "rotation",
39 "time_behind_play",
40 StatUnit::Seconds,
41 self.time_behind_play,
42 ));
43 visitor(ExportedStat::float(
44 "rotation",
45 "time_level_with_play",
46 StatUnit::Seconds,
47 self.time_level_with_play,
48 ));
49 visitor(ExportedStat::float(
50 "rotation",
51 "time_ahead_of_play",
52 StatUnit::Seconds,
53 self.time_ahead_of_play,
54 ));
55 visitor(ExportedStat::float(
56 "rotation",
57 "percent_first_man",
58 StatUnit::Percent,
59 self.first_man_pct(),
60 ));
61 visitor(ExportedStat::float(
62 "rotation",
63 "percent_second_man",
64 StatUnit::Percent,
65 self.second_man_pct(),
66 ));
67 visitor(ExportedStat::float(
68 "rotation",
69 "percent_third_man",
70 StatUnit::Percent,
71 self.third_man_pct(),
72 ));
73 visitor(ExportedStat::float(
74 "rotation",
75 "percent_ambiguous_role",
76 StatUnit::Percent,
77 self.ambiguous_role_pct(),
78 ));
79 visitor(ExportedStat::float(
80 "rotation",
81 "percent_behind_play",
82 StatUnit::Percent,
83 self.behind_play_pct(),
84 ));
85 visitor(ExportedStat::float(
86 "rotation",
87 "percent_level_with_play",
88 StatUnit::Percent,
89 self.level_with_play_pct(),
90 ));
91 visitor(ExportedStat::float(
92 "rotation",
93 "percent_ahead_of_play",
94 StatUnit::Percent,
95 self.ahead_of_play_pct(),
96 ));
97 visitor(ExportedStat::unsigned(
98 "rotation",
99 "first_man_stints",
100 StatUnit::Count,
101 self.first_man_stint_count,
102 ));
103 visitor(ExportedStat::float(
104 "rotation",
105 "longest_first_man_stint_time",
106 StatUnit::Seconds,
107 self.longest_first_man_stint_time,
108 ));
109 visitor(ExportedStat::float(
110 "rotation",
111 "avg_first_man_stint_time",
112 StatUnit::Seconds,
113 self.average_first_man_stint_time(),
114 ));
115 visitor(ExportedStat::unsigned(
116 "rotation",
117 "became_first_man",
118 StatUnit::Count,
119 self.became_first_man_count,
120 ));
121 visitor(ExportedStat::unsigned(
122 "rotation",
123 "lost_first_man",
124 StatUnit::Count,
125 self.lost_first_man_count,
126 ));
127 }
128}
129
130impl StatFieldProvider for RotationTeamStats {
131 fn visit_stat_fields(&self, visitor: &mut dyn FnMut(ExportedStat)) {
132 visitor(ExportedStat::unsigned(
133 "rotation",
134 "first_man_changes_for_team",
135 StatUnit::Count,
136 self.first_man_changes_for_team,
137 ));
138 visitor(ExportedStat::unsigned(
139 "rotation",
140 "rotation_count",
141 StatUnit::Count,
142 self.rotation_count,
143 ));
144 }
145}