pub enum PlayerId {
ALICE = 0,
BOB = 1,
}Expand description
IDs of the players in a two-player game.
This enumeration defines the two possible players. The numeric values (0 and 1) can be used for array indexing and other performance-critical operations. These are provided for convenience and are not required to be used.
§Examples
let current_player = PlayerId::ALICE;
let player_index = current_player as usize; // 0Variants§
Implementations§
Trait Implementations§
impl Copy for PlayerId
impl Eq for PlayerId
impl StructuralPartialEq for PlayerId
Auto Trait Implementations§
impl Freeze for PlayerId
impl RefUnwindSafe for PlayerId
impl Send for PlayerId
impl Sync for PlayerId
impl Unpin for PlayerId
impl UnwindSafe for PlayerId
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