Struct riichi_tools_rs::riichi::tile::Tile [−][src]
pub struct Tile { pub tile_type: TileType, pub is_red: bool, pub is_open: bool, pub is_draw: bool, pub is_chi: bool, pub is_pon: bool, pub called_from: u8, pub is_kan: bool, pub is_riichi: bool, pub is_tsumogiri: bool, pub id_136: Option<u8>, }
Fields
tile_type: TileType
is_red: bool
is_open: bool
is_draw: bool
is_chi: bool
is_pon: bool
called_from: u8
is_kan: bool
is_riichi: bool
is_tsumogiri: bool
id_136: Option<u8>
Implementations
impl Tile
[src]
impl Tile
[src]pub fn new(tile_type: TileType) -> Tile
[src]
pub fn from_text(representation: &str) -> Result<Tile, RiichiError>
[src]
pub fn from_id(id: u8) -> Result<Tile, RiichiError>
[src]
id is an integer value > 0 of a tile. The order is Manzu - Pinzu - Souzu - Winds - Dragons
pub fn to_id(&self) -> u8
[src]
Gets the id of this tile based on its type
pub fn to_id_minus_1(&self) -> u8
[src]
Some algorithms use ids starting from 0
pub fn next_id(&self, dora: bool, depth: u8) -> u8
[src]
Returns an ID of the next tile in order.
pub fn prev_id(&self, dora: bool, depth: u8) -> u8
[src]
Returns an ID of the previous tile in order.
pub fn next(&self, dora: bool) -> Option<Tile>
[src]
1-8 returns the next number 9 returns None for dora = false, 1 for dora = true honors return None for dora = false, honor order for dora = true
pub fn prev(&self) -> Option<Tile>
[src]
pub fn is_terminal(&self) -> bool
[src]
pub fn is_honor(&self) -> bool
[src]
pub fn is_terminal_or_honor(&self) -> bool
[src]
pub fn get_type_char(&self) -> char
[src]
pub fn get_value(&self) -> u8
[src]
Trait Implementations
impl PartialOrd<Tile> for Tile
[src]
impl PartialOrd<Tile> for Tile
[src]impl Serialize for Tile
[src]
impl Serialize for Tile
[src]fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Auto Trait Implementations
impl RefUnwindSafe for Tile
impl RefUnwindSafe for Tile
impl UnwindSafe for Tile
impl UnwindSafe for Tile