pub struct SchnapsenDuo { /* private fields */ }
Implementations§
Source§impl SchnapsenDuo
impl SchnapsenDuo
pub fn new(player_ids: &[String; 2]) -> Self
pub fn on_priv_event( &mut self, player: Arc<RwLock<Player>>, callback: impl Fn(PrivateEvent) + Send + Sync + 'static, )
pub fn on_pub_event( &mut self, callback: impl Fn(PublicEvent) + Send + Sync + 'static, )
pub fn off_pub_event( &mut self, callback: impl Fn(PublicEvent) + Send + Sync + 'static, )
pub fn off_priv_event( &mut self, player: &Player, callback: impl Fn(PrivateEvent) + Send + Sync + 'static, )
pub fn get_player(&self, player_id: &str) -> Option<Arc<RwLock<Player>>>
pub fn get_non_active_player(&self) -> Option<Arc<RwLock<Player>>>
pub fn cutt_deck( &mut self, player: Arc<RwLock<Player>>, cards_to_take: usize, ) -> Result<(), PlayerError>
pub fn is_active(&self, player: &Player) -> bool
pub fn close_talon( &mut self, player: Arc<RwLock<Player>>, ) -> Result<(), PlayerError>
pub fn take_cards_til( &mut self, player: Arc<RwLock<Player>>, idx: usize, ) -> Result<Vec<Card>, PlayerError>
pub fn get_player_with_greatest_card( &self, ) -> Result<Arc<RwLock<Player>>, PlayerError>
pub fn recreate_deck(&mut self)
pub fn distribute_cards(&mut self) -> Result<(), PlayerError>
pub fn set_active_player( &mut self, player: Arc<RwLock<Player>>, ) -> Result<(), PlayerError>
pub fn play_card( &mut self, player: Arc<RwLock<Player>>, card: Card, ) -> Result<(), PlayerError>
pub fn swap_trump( &mut self, player: Arc<RwLock<Player>>, card: Card, ) -> Result<Card, PlayerError>
pub fn announce_40( &mut self, player: &Player, ) -> Result<Announcement, PlayerError>
pub fn announce_20( &mut self, player: &Player, cards: [Card; 2], ) -> Result<Announcement, PlayerError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SchnapsenDuo
impl !RefUnwindSafe for SchnapsenDuo
impl Unpin for SchnapsenDuo
impl !UnwindSafe for SchnapsenDuo
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