pub enum HandGroup {
Koutsu(Tile),
Shuntsu(Tile),
}Expand description
A group of 3 tiles within a player’s closed hand, a.k.a. Mentsu (面子).
Can be either:
- Koutsu ((暗)刻子): 3 of a kind (ignoring red); e.g.
222z,055m - Shuntsu ((暗)順子): 3 consecutive numerals (ignoring red); e.g.
789m,406s
These are like Chii and Pon respectively, except concealed.
It can be encoded as a 6-bit integer (the same size as a Tile!), with 2 bitfields:
-
[3:0]:[111, 123, 222, 234, 333, 345, 444, 456, 555, 567, 666, 678, 777, 789, 888, 999]. Basically with999shifting 1 place to occupy the encoding for89A(invalid). For suit 3 (honors),123,234, …,789,888,999are all invalid. -
[5:4]: suit (0/1/2/3 = m/p/s/z)
§Optional serde support
{type, tile} where type is "Shuntsu" or "Koutsu".
Variants§
Koutsu(Tile)
Koutsu (暗)刻子: 3 of a kind (ignoring red); e.g. 222z, 055m.
The tile argument is the repeated tile.
Shuntsu(Tile)
Shuntsu (暗)順子: 3 consecutives (ignoring red); e.g. 789m, 406s.
The tile argument is the minimum (normal) tile in the group.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HandGroup
impl<'de> Deserialize<'de> for HandGroup
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>,
Source§impl Ord for HandGroup
impl Ord for HandGroup
Source§impl PartialOrd for HandGroup
impl PartialOrd for HandGroup
impl Copy for HandGroup
impl Eq for HandGroup
impl StructuralPartialEq for HandGroup
Auto Trait Implementations§
impl Freeze for HandGroup
impl RefUnwindSafe for HandGroup
impl Send for HandGroup
impl Sync for HandGroup
impl Unpin for HandGroup
impl UnwindSafe for HandGroup
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
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>
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>
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