Skip to main content

StatsSample

Struct StatsSample 

Source
pub struct StatsSample {
Show 21 fields pub frame_number: usize, pub time: f32, pub dt: f32, pub seconds_remaining: Option<i32>, pub game_state: Option<i32>, pub ball_has_been_hit: Option<bool>, pub kickoff_countdown_time: Option<i32>, pub team_zero_score: Option<i32>, pub team_one_score: Option<i32>, pub possession_team_is_team_0: Option<bool>, pub scored_on_team_is_team_0: Option<bool>, pub current_in_game_team_player_counts: Option<[usize; 2]>, pub ball: Option<BallSample>, pub players: Vec<PlayerSample>, pub active_demos: Vec<DemoEventSample>, pub demo_events: Vec<DemolishInfo>, pub boost_pad_events: Vec<BoostPadEvent>, pub touch_events: Vec<TouchEvent>, pub dodge_refreshed_events: Vec<DodgeRefreshedEvent>, pub player_stat_events: Vec<PlayerStatEvent>, pub goal_events: Vec<GoalEvent>,
}

Fields§

§frame_number: usize§time: f32§dt: f32§seconds_remaining: Option<i32>§game_state: Option<i32>§ball_has_been_hit: Option<bool>§kickoff_countdown_time: Option<i32>§team_zero_score: Option<i32>§team_one_score: Option<i32>§possession_team_is_team_0: Option<bool>§scored_on_team_is_team_0: Option<bool>§current_in_game_team_player_counts: Option<[usize; 2]>§ball: Option<BallSample>§players: Vec<PlayerSample>§active_demos: Vec<DemoEventSample>§demo_events: Vec<DemolishInfo>§boost_pad_events: Vec<BoostPadEvent>§touch_events: Vec<TouchEvent>§dodge_refreshed_events: Vec<DodgeRefreshedEvent>§player_stat_events: Vec<PlayerStatEvent>§goal_events: Vec<GoalEvent>

Implementations§

Source§

impl StatsSample

Source

pub fn is_live_play(&self) -> bool

Returns whether time-based stats should treat this sample as live play.

We exclude frozen kickoff countdown frames and post-goal replay frames, but keep the movable pre-touch kickoff approach live.

Use LivePlayTracker when you need to exclude the full post-goal reset segment that can continue after the goal frame itself.

Source

pub fn current_in_game_team_player_count(&self, is_team_0: bool) -> usize

Trait Implementations§

Source§

impl Clone for StatsSample

Source§

fn clone(&self) -> StatsSample

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StatsSample

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.