pub struct Player {Show 20 fields
pub(crate) con: Option<Connection>,
name: String,
pub role: PlayerRole,
pub(super) reconnect_token: ReconnectToken,
pub character: Option<PlayerCharacter>,
pub ready: bool,
pub player_in_matchup: PlayerInMatchup,
pub lives: i64,
pub fights_won: u64,
pub red_lightsabers: Vec<f64>,
pub green_lightsabers: Vec<f64>,
pub blue_lightsabers: Vec<f64>,
pub unit_bank: Vec<UnitType>,
pub unit_placement: Vec<PlacedUnit>,
pub(crate) lightsaber_choice: Result<LightsaberType, Option<OwnedSemaphorePermit>>,
pub(crate) lightsaber_choice_allowed: bool,
pub(crate) unit_choice: Result<UnitType, Option<OwnedSemaphorePermit>>,
pub(crate) unit_choice_allowed: bool,
pub(crate) new_placement: Result<(Vec<PlacedUnit>, Vec<UnitType>), Option<OwnedSemaphorePermit>>,
pub(crate) new_placement_allowed: bool,
}Fields§
§con: Option<Connection>Some(_) as long as the player is connected, None after a disconnect and before a reconnect.
name: String§role: PlayerRole§reconnect_token: ReconnectToken§character: Option<PlayerCharacter>Some(_) after game start
ready: bool§player_in_matchup: PlayerInMatchupEither Player1 or Player2.
Controls which coordinates this player should use (from 0,0 for Player1)
lives: i64§fights_won: u64§red_lightsabers: Vec<f64>§green_lightsabers: Vec<f64>§blue_lightsabers: Vec<f64>§unit_bank: Vec<UnitType>§unit_placement: Vec<PlacedUnit>§lightsaber_choice: Result<LightsaberType, Option<OwnedSemaphorePermit>>§lightsaber_choice_allowed: bool§unit_choice: Result<UnitType, Option<OwnedSemaphorePermit>>§unit_choice_allowed: bool§new_placement: Result<(Vec<PlacedUnit>, Vec<UnitType>), Option<OwnedSemaphorePermit>>§new_placement_allowed: boolImplementations§
Source§impl Player
impl Player
pub fn new(name: String, role: PlayerRole, con: Connection) -> Self
pub fn name(&self) -> &str
pub fn reconnect_token(&self) -> &ReconnectToken
Trait Implementations§
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