Struct riichi_tools_rs::riichi::table::Table[][src]

pub struct Table { /* fields omitted */ }

Representation of the game state

Implementations

impl Table[src]

pub fn from_map(params: &Map<String, Value>) -> Result<Table, RiichiError>[src]

pub fn set_seat(&mut self, seat: u8)[src]

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

pub fn set_my_tsumo(&mut self, value: bool)[src]

pub fn set_p1_tsumo(&mut self, value: bool)[src]

pub fn set_p2_tsumo(&mut self, value: bool)[src]

pub fn set_p3_tsumo(&mut self, value: bool)[src]

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

pub fn set_my_riichi(&mut self, value: bool)[src]

pub fn set_p1_riichi(&mut self, value: bool)[src]

pub fn set_p2_riichi(&mut self, value: bool)[src]

pub fn set_p3_riichi(&mut self, value: bool)[src]

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

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

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

pub fn set_riichi_declaring_player(&mut self, player_id: u8)[src]

pub fn unset_riichi_declaring_player(&mut self)[src]

pub fn get_riichi_declaring_player(&self) -> Option<u8>[src]

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

pub fn set_my_hand(&mut self, hand: Hand)[src]

pub fn get_my_hand(&self) -> &Hand[src]

pub fn get_my_hand_option(&self) -> &Option<Hand>[src]

pub fn get_my_winning_tile(&self) -> Tile[src]

pub fn set_tiles_remaining(&mut self, value: u8)[src]

pub fn get_tiles_remaining(&self) -> Option<u8>[src]

pub fn decrement_tiles_remaining(&mut self)[src]

pub fn set_my_seat_wind(&mut self, value: u8)[src]

pub fn get_my_seat_wind(&self) -> Option<u8>[src]

pub fn set_my_initial_seat_wind(&mut self, value: u8)[src]

pub fn get_my_initial_seat_wind(&self) -> Option<u8>[src]

pub fn set_prevalent_wind(&mut self, value: u8)[src]

pub fn get_prevalent_wind(&self) -> Option<u8>[src]

pub fn set_dealer_turn(&mut self, value: u8)[src]

pub fn get_dealer_turn(&self) -> Option<u8>[src]

pub fn set_points(&mut self, player: u8, value: i32)[src]

pub fn get_my_points(&self) -> Option<i32>[src]

pub fn get_placing(&self) -> u8[src]

pub fn set_dora_indicators(&mut self, indicators: Vec<Tile>)[src]

pub fn add_dora_indicator(&mut self, indicator: Tile)[src]

pub fn get_dora_indicators(&self) -> &Vec<Tile>[src]

pub fn add_tile_to_visible_tiles(&mut self, tile: Tile)[src]

pub fn reset_tile_vectors(&mut self)[src]

pub fn get_visible_tiles(&self) -> &[u8; 34][src]

pub fn set_total_round(&mut self, value: u8)[src]

pub fn get_total_round(&self) -> Option<u8>[src]

pub fn set_riichi_sticks(&mut self, value: u8)[src]

pub fn get_riichi_sticks(&self) -> u8[src]

pub fn set_tsumibo(&mut self, value: u8)[src]

pub fn get_tsumibo(&self) -> u8[src]

pub fn set_rules(&mut self, rules: Rules)[src]

pub fn get_rules(&self) -> &Option<Rules>[src]

pub fn get_my_discards(&self) -> &Vec<Tile>[src]

pub fn add_tile_to_discards(&mut self, player: u8, tile: Tile)[src]

pub fn add_tile_to_safe_tiles(&mut self, player: u8, tile: Tile)[src]

pub fn yaku(&mut self) -> Option<(Vec<Yaku>, Score)>[src]

Finds yaku based on the table state. Some yaku depend on winds, tsumo / ron, tiles remaining etc.

pub fn can_pon(&self, tile: &Tile) -> Option<Vec<Tile>>[src]

Can my hand pon this tile? And if so, with which tiles?

pub fn can_ankan(&self) -> Option<Vec<Tile>>[src]

Can my hand do an ankan (closed kan)? And if so, with what tile?

pub fn tile_safety(&self, tile: &Tile) -> f32[src]

How safe is this tile to discard based on this table state? This function should look at these criteria:

  • other players discards
  • temporary furiten
  • other player’s calls (chinitsu / honitsu / sanshoku / ittsu calls etc.)
  • suji
  • kabe
  • player’s tenpai potential (riichi = 100% tenpai…)

pub fn tenpai_probability(&self, player: u8) -> f32[src]

Guesses a player’s tenpai probability based on:

  • their riichi state (100% tenpai if riichi)
  • discards
  • tiles remaining
  • calls

Auto Trait Implementations

impl RefUnwindSafe for Table

impl Send for Table

impl Sync for Table

impl Unpin for Table

impl UnwindSafe for Table

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, 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>,