[][src]Struct bk2d::utils::Players

pub struct Players<P> {
    pub players: Vec<P>,
    pub current: Option<usize>,
}

Fields

players: Vec<P>current: Option<usize>

Methods

impl<P> Players<P>[src]

pub fn new() -> Players<P>[src]

pub fn sure_start(&self, msg: &str)[src]

pub fn not_start(&self, msg: &str)[src]

pub fn start(&mut self)[src]

pub fn is_start(&self) -> bool[src]

pub fn add(&mut self, p: P)[src]

pub fn remove(&mut self, i: usize)[src]

pub fn current_index(&self) -> usize[src]

pub fn current_ref(&self) -> &P[src]

pub fn current_mut(&mut self) -> &mut P[src]

pub fn next_player(&mut self) -> usize[src]

impl<P: Player> Players<P>[src]

pub fn current_ident(&self) -> &<P as Player>::Ident[src]

Trait Implementations

impl<P: Clone> Clone for Players<P>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<P: Default> Default for Players<P>[src]

impl<P: Debug> Debug for Players<P>[src]

Auto Trait Implementations

impl<P> Send for Players<P> where
    P: Send

impl<P> Unpin for Players<P> where
    P: Unpin

impl<P> Sync for Players<P> where
    P: Sync

impl<P> UnwindSafe for Players<P> where
    P: UnwindSafe

impl<P> RefUnwindSafe for Players<P> where
    P: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]