#[non_exhaustive]pub struct Chii {
pub own: [Tile; 2],
pub called: Tile,
pub min: Tile,
}Expand description
An open group of 3 consecutive tiles (チー / 明順). The called tile may only come from the previous player’s discard.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.own: [Tile; 2]The calling player’s own 2 tiles.
called: TileThe called tile.
min: TileThe smallest tile (ignoring red) in the group.
Implementations§
Source§impl Chii
impl Chii
pub const fn dir(self) -> u8
pub const fn suit(self) -> u8
Sourcepub fn from_tiles(own0: Tile, own1: Tile, called: Tile) -> Option<Self>
pub fn from_tiles(own0: Tile, own1: Tile, called: Tile) -> Option<Self>
Construct from own tiles and the called tile.
Sourcepub fn is_in_hand(self, hand: &TileSet37) -> bool
pub fn is_in_hand(self, hand: &TileSet37) -> bool
Checks whether own tiles exist in player’s closed hand.
Sourcepub fn consume_from_hand(self, hand: &mut TileSet37)
pub fn consume_from_hand(self, hand: &mut TileSet37)
Removes own tiles from player’s closed hand (assuming they exist).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Chii
impl<'de> Deserialize<'de> for Chii
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Chii
impl Eq for Chii
impl StructuralPartialEq for Chii
Auto Trait Implementations§
impl Freeze for Chii
impl RefUnwindSafe for Chii
impl Send for Chii
impl Sync for Chii
impl Unpin for Chii
impl UnwindSafe for Chii
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more