Skip to main content

subtr_actor/stats/analysis_graph/nodes/
ball_frame_state.rs

1use super::*;
2use crate::stats::calculators::*;
3use crate::*;
4
5pub struct BallFrameStateNode {
6    state: BallFrameState,
7}
8
9impl BallFrameStateNode {
10    pub fn new() -> Self {
11        Self {
12            state: BallFrameState::default(),
13        }
14    }
15}
16
17impl_analysis_node! {
18    node = BallFrameStateNode,
19    state = BallFrameState,
20    name = "ball_frame_state",
21    dependencies = [AnalysisDependency::required::<FrameInput>()],
22    inputs = { frame_input: FrameInput },
23    evaluate = |node| {
24        node.state = frame_input.ball_frame_state();
25        Ok(())
26    },
27    state_ref = |node| &node.state,
28}