riichi_elements/typedefs.rs
1use crate::player::Player;
2
3/// Points / point differences. Usually increments of 100.
4pub type GamePoints = i64;
5
6/// Wind index --- 0, 1, 2, 3 => east, south, west, north.
7///
8/// Note that this is _identical_ to [`Player`] --- see its definition.
9pub type Wind = Player;
10
11/// Catch-all error for cases where details of the error are unnecessary.
12#[derive(Debug)]
13pub struct UnspecifiedError;
14
15#[cfg(feature = "std")]
16impl std::error::Error for UnspecifiedError {}
17
18impl core::fmt::Display for UnspecifiedError {
19 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
20 write!(f, "Unspecified error from riichi-elements.")
21 }
22}