pub enum Meld {
Chii(Chii),
Pon(Pon),
Kakan(Kakan),
Daiminkan(Daiminkan),
Ankan(Ankan),
}Expand description
Sum type of all kinds of melds (副露).
This is one of: Chii, Pon, Kakan, Daiminkan, Ankan.
§Optional serde support
{type, ...} where ... represents the flattened fields of the actual meld.
Examples:
{"type": "Chii", "own": ["4s", "6s"], "called": "0s", "min": "4s"}{"type": "Pon", "own": ["0p", "5p"], "called": "0p", "dir": 2}{"type": "Kakan", "own": ["0p", "5p"], "called": "0p", "dir": 1, "added": "5p"}{"type": "Daiminkan", "own": ["0s", "5s", "5s"], "called": "0s", "dir": 3}{"type": "Ankan", "own": ["4z", "4z", "4z", "4z"]}
Variants§
Chii(Chii)
See Chii.
Pon(Pon)
See Pon.
Kakan(Kakan)
See Kakan.
Daiminkan(Daiminkan)
See Daiminkan.
Ankan(Ankan)
See Ankan.
Implementations§
Source§impl Meld
impl Meld
Sourcepub fn to_equivalent_group(&self) -> HandGroup
pub fn to_equivalent_group(&self) -> HandGroup
Maps to the equivalent closed-hand group. Useful for e.g. winning condition calculations.
Chii=>HandGroup::ShuntsuPon/Kan =>HandGroup::Koutsu(ignoring the 4th tile)
Sourcepub fn consume_from_hand(&self, hand: &mut TileSet37)
pub fn consume_from_hand(&self, hand: &mut TileSet37)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Meld
impl<'de> Deserialize<'de> for Meld
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 Meld
impl Eq for Meld
impl StructuralPartialEq for Meld
Auto Trait Implementations§
impl Freeze for Meld
impl RefUnwindSafe for Meld
impl Send for Meld
impl Sync for Meld
impl Unpin for Meld
impl UnwindSafe for Meld
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