pub struct Player {
pub id: usize,
pub instance_id: u16,
pub character: String,
pub account: String,
pub is_self: bool,
pub profession: Profession,
pub elite: Specialization,
pub subgroup: usize,
pub combat: bool,
}
Expand description
Struct representing a player.
Fields§
§id: usize
Player id.
instance_id: u16
§character: String
Player character name.
account: String
Player account name.
is_self: bool
Whether the player is the local player.
profession: Profession
Profession (class) of the player character.
elite: Specialization
Current elite specialization the player has equipped.
subgroup: usize
Current squad subgroup the player is in.
combat: bool
Whether the player is currently in combat.
Implementations§
source§impl Player
impl Player
sourcepub fn new(
id: usize,
instance_id: u16,
character: impl Into<String>,
account: impl Into<String>,
is_self: bool,
profession: Profession,
elite: Specialization,
subgroup: usize
) -> Self
pub fn new( id: usize, instance_id: u16, character: impl Into<String>, account: impl Into<String>, is_self: bool, profession: Profession, elite: Specialization, subgroup: usize ) -> Self
Creates a new player.
sourcepub fn from_tracking_change(src: &Agent, dst: &Agent) -> Option<Self>
pub fn from_tracking_change(src: &Agent, dst: &Agent) -> Option<Self>
Creates a new player from tracking change agents.
sourcepub fn enter_combat(&mut self, new_subgroup: Option<usize>)
pub fn enter_combat(&mut self, new_subgroup: Option<usize>)
Enters the player into combat.
sourcepub fn exit_combat(&mut self)
pub fn exit_combat(&mut self)
Exits the player from combat.
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
source§impl From<Player> for CachedPlayer
impl From<Player> for CachedPlayer
source§impl Ord for Player
impl Ord for Player
source§impl PartialEq for Player
impl PartialEq for Player
source§impl PartialOrd for Player
impl PartialOrd for Player
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq 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