Player

Struct Player 

Source
pub struct Player { /* private fields */ }
Expand description

Game-specific player representation. Includes generally immutable information alongside data specific to the replay being parsed.

Implementations§

Source§

impl Player

Source

pub fn name(&self) -> &str

Name of the player at the time the replay was recorded. Note that the player may have changed their name since time of recording. If attempting to uniquely identify players across replay files, look at Player::steam_id and Player::profile_id instead. The string is UTF-16 encoded.

Source

pub fn human(&self) -> bool

Whether or not the player was a human or an AI/CPU player.

Source

pub fn faction(&self) -> Faction

The faction selected by the player in this match.

Source

pub fn team(&self) -> Team

The team the player was assigned to. Currently only head-to-head matchups are supported (max two teams).

Source

pub fn battlegroup(&self) -> Option<u32>

The pbgid of the battlegroup the player selected, or None if no battlegroup was selected. For details on what this ID represents please see SelectBattlegroup::pbgid.

Source

pub fn steam_id(&self) -> Option<u64>

The Steam ID of the player, or None if the player is AI. This ID can be used to uniquely identify a player between replays, and connect them to their Steam profile.

Source

pub fn profile_id(&self) -> Option<u64>

The Relic profile ID of the player, or None if the player is AI. This ID can be used to uniquely identify a player between replays, and can be used to query statistical information about the player from Relic’s stats API.

Source

pub fn messages(&self) -> Vec<Message>

A list of all messages sent by the player in the match. Sorted chronologically from first to last.

Source

pub fn commands(&self) -> Vec<Command>

A list of all commands executed by the player in the match. Sorted chronologically from first to last.

Source

pub fn build_commands(&self) -> Vec<Command>

A list of only build-related commands executed by the player in the match. A build command is any that enqueues the construction of a new unit or upgrade. Sorted chronologically from first to last.

Source

pub fn battlegroup_commands(&self) -> Vec<Command>

A list of only battlegroup-related commands executed by the player in the match. A battlegroup command is any that involves the select or use of battlegroups and their abilities.

Trait Implementations§

Source§

impl Clone for Player

Source§

fn clone(&self) -> Player

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 Player

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Player

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Player

§

impl RefUnwindSafe for Player

§

impl Send for Player

§

impl Sync for Player

§

impl Unpin for Player

§

impl UnwindSafe for Player

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.