Struct riichi_tools_rs::riichi::shapes::Shape[][src]

pub struct Shape { /* fields omitted */ }

A hand consists of shapes. A tenpai hand has (usually) only 1 incomplete shape. Exceptions are for example 23456 wait, where you can either have 234 (complete) & 56 (incomplete), or 23 (incomplete) and 456 (complete) Or, shanpon wait (1155 = 11 pair 55 incomplete, or 11 incomplete 55 pair) Or, 13-sided kokushi, or 9-sided nine gates

Implementations

impl Shape[src]

pub fn new(shape_type: ShapeType, tile_count: u8, is_open: bool) -> Shape[src]

pub fn get_shape_type(&self) -> &ShapeType[src]

pub fn is_open(&self) -> bool[src]

pub fn from_tiles(
    tiles: &[Tile],
    is_open: bool,
    only_complete: bool
) -> Result<Shape, RiichiError>
[src]

Creates a shape from the given tiles. TODO incomplete shapes

pub fn are_in_shape(first_tile_id: u8, second_tile_id: u8) -> bool[src]

Are these two tiles in a shape together?

Trait Implementations

impl Clone for Shape[src]

impl Copy for Shape[src]

impl Debug for Shape[src]

impl Display for Shape[src]

Auto Trait Implementations

impl RefUnwindSafe for Shape

impl Send for Shape

impl Sync for Shape

impl Unpin for Shape

impl UnwindSafe for Shape

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,