pub struct TileSet34(pub [u8; 34]);Expand description
Histogram for all 34 kinds of normal tiles (red 5’s are treated as normal 5’s).
Can be directly indexed with Tile.
Tuple Fields§
§0: [u8; 34]Implementations§
Source§impl TileSet34
impl TileSet34
Sourcepub const fn complete_set() -> Self
pub const fn complete_set() -> Self
The complete set of tiles in a game, without differentiating red 5’s from normal 5’s. The total number of tiles is 136 (34 x 4).
Sourcepub fn from_packed(packed: [u32; 4]) -> Self
pub fn from_packed(packed: [u32; 4]) -> Self
Reconstructs the histogram from its packed representation.
Sourcepub fn packed_34(&self) -> [u32; 4]
pub fn packed_34(&self) -> [u32; 4]
Compresses the histogram so that each element takes 3 bits (valid range 0..=4).
This results in 4 x 27-bit integers, one for each suit.
Conveniently, this is 1 digit per element in octal.
Sourcepub fn iter_tiles(&self) -> impl Iterator<Item = Tile>
pub fn iter_tiles(&self) -> impl Iterator<Item = Tile>
Iterates through all tiles in this tile set, in encoding order.
Trait Implementations§
Source§impl From<TileSet34> for TileMask34
impl From<TileSet34> for TileMask34
Source§impl FromIterator<Tile> for TileSet34
impl FromIterator<Tile> for TileSet34
Source§impl IntoIterator for TileSet34
impl IntoIterator for TileSet34
impl Eq for TileSet34
impl StructuralPartialEq for TileSet34
Auto Trait Implementations§
impl Freeze for TileSet34
impl RefUnwindSafe for TileSet34
impl Send for TileSet34
impl Sync for TileSet34
impl Unpin for TileSet34
impl UnwindSafe for TileSet34
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