pub struct ReadyCheck {
pub votes: HashMap<PlayerId, bool>,
pub state: ReadyCheckState,
/* private fields */
}Fields§
§votes: HashMap<PlayerId, bool>§state: ReadyCheckStateImplementations§
Source§impl ReadyCheck
impl ReadyCheck
pub fn new(timeout_secs: f32) -> Self
Sourcepub fn add_participant(&mut self, player_id: PlayerId)
pub fn add_participant(&mut self, player_id: PlayerId)
Register a player as participating in this check.
Sourcepub fn check(&mut self) -> ReadyCheckState
pub fn check(&mut self) -> ReadyCheckState
Check if all participants voted ready.
pub fn cancel(&mut self)
pub fn ready_count(&self) -> usize
pub fn total_count(&self) -> usize
Auto Trait Implementations§
impl Freeze for ReadyCheck
impl RefUnwindSafe for ReadyCheck
impl Send for ReadyCheck
impl Sync for ReadyCheck
impl Unpin for ReadyCheck
impl UnsafeUnpin for ReadyCheck
impl UnwindSafe for ReadyCheck
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