Skip to main content

subtr_actor/stats/analysis_graph/nodes/
touch_state.rs

1use super::*;
2use crate::stats::calculators::*;
3use crate::*;
4
5/// Detects raw ball touches per frame from ball/player state and frame events as shared state.
6pub struct TouchStateNode {
7    calculator: TouchStateCalculator,
8    state: TouchState,
9}
10
11impl TouchStateNode {
12    pub fn new() -> Self {
13        Self {
14            calculator: TouchStateCalculator::new(),
15            state: TouchState::default(),
16        }
17    }
18}
19
20impl_analysis_node! {
21    node = TouchStateNode,
22    state = TouchState,
23    name = "touch_state",
24    dependencies = [
25        frame_info_dependency() => FrameInfo,
26        ball_frame_state_dependency() => BallFrameState,
27        player_frame_state_dependency() => PlayerFrameState,
28        frame_events_state_dependency() => FrameEventsState,
29        live_play_dependency() => LivePlayState,
30    ],
31    update_state = calculator.update,
32}