Enum azalea_core::GameMode
source · pub enum GameMode {
Survival,
Creative,
Adventure,
Spectator,
}
Expand description
A Minecraft gamemode, like survival or creative.
Variants§
Implementations§
source§impl GameMode
impl GameMode
pub fn to_id(&self) -> u8
sourcepub fn to_optional_id<T: Into<Option<GameMode>>>(game_type: T) -> i8
pub fn to_optional_id<T: Into<Option<GameMode>>>(game_type: T) -> i8
Get the id of the game type, but return -1 if the game type is invalid.
pub fn from_id(id: u8) -> Option<GameMode>
pub fn from_optional_id(id: i8) -> Option<OptionalGameType>
pub fn short_name(&self) -> &'static str
pub fn long_name(&self) -> &'static str
pub fn from_name(name: &str) -> GameMode
Trait Implementations§
source§impl McBufReadable for GameMode
impl McBufReadable for GameMode
source§impl McBufWritable for GameMode
impl McBufWritable for GameMode
source§impl PartialEq<GameMode> for GameMode
impl PartialEq<GameMode> for GameMode
impl Copy for GameMode
impl Eq for GameMode
impl StructuralEq for GameMode
impl StructuralPartialEq for GameMode
Auto Trait Implementations§
impl RefUnwindSafe for GameMode
impl Send for GameMode
impl Sync for GameMode
impl Unpin for GameMode
impl UnwindSafe for GameMode
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