#[non_exhaustive]pub struct Player {Show 16 fields
pub entity: EntityId,
pub position: Vector,
pub health: u16,
pub max_health: u16,
pub class: Class,
pub team: Team,
pub view_angle: f32,
pub pitch_angle: f32,
pub state: PlayerState,
pub info: Option<UserInfo>,
pub charge: u8,
pub simtime: u16,
pub ping: u16,
pub in_pvs: bool,
pub bounds: Box,
pub weapons: [Handle; 3],
/* private fields */
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.entity: EntityId
§position: Vector
§health: u16
§max_health: u16
§class: Class
§team: Team
§view_angle: f32
§pitch_angle: f32
§state: PlayerState
§info: Option<UserInfo>
§charge: u8
§simtime: u16
§ping: u16
§in_pvs: bool
§bounds: Box
§weapons: [Handle; 3]
Implementations§
Source§impl Player
impl Player
pub fn new(entity: EntityId) -> Player
pub fn collides(&self, projectile: &Projectile, time_per_tick: f32) -> bool
pub fn conditions(&self) -> impl Iterator<Item = PlayerCondition> + '_
pub fn has_condition(&self, condition: PlayerCondition) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Player
impl<'de> Deserialize<'de> for Player
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Player
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more