pub struct TouchIntentionClassifier { /* private fields */ }Expand description
Stateful helper that classifies the intention of each touch.
Holds the small amount of cross-frame state classification needs: the reception in progress (for first-touch detection) and a short backward window of replay-reported shot/save stat events (for replay-confirmed classification).
Implementations§
Source§impl TouchIntentionClassifier
impl TouchIntentionClassifier
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Clear cross-frame state at a live-play boundary so each kickoff starts a fresh reception sequence.
Sourcepub fn begin_frame(
&mut self,
frame: &FrameInfo,
player_stat_events: &[PlayerStatEvent],
)
pub fn begin_frame( &mut self, frame: &FrameInfo, player_stat_events: &[PlayerStatEvent], )
Ingest this frame’s replay-reported stat events and drop ones that have aged out of the matching window.
Sourcepub fn classify(
&mut self,
touch: &TouchEvent,
player_id: &PlayerId,
ctx: &TouchIntentionFrameContext<'_>,
) -> TouchActionResolution
pub fn classify( &mut self, touch: &TouchEvent, player_id: &PlayerId, ctx: &TouchIntentionFrameContext<'_>, ) -> TouchActionResolution
Classify one touch’s action and advance first-touch tracking.
Touches must be supplied in chronological order. The precedence ladder:
replay-confirmed saves and shots first (game-authoritative), then
trajectory-based saves, shots, clears out of the defensive third, booms
downfield into space, and passes led toward a teammate. A touch matching
none of these has no action (None) rather than a catch-all value.
contested is not a rung — it is reported on the resolution as an
independent flag, so a contested touch keeps its real action (a contested
shot stays a shot). The possession axis is likewise independent: a
ControlFollowTracker window may later record control/advance on a
pass/clear/boom or action-less touch without changing its action.