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: Rc<RefCell<Player>>, callback: impl Fn(PrivateEvent) + Send + Sync + 'static, )
pub fn on_pub_event( &mut self, callback: impl Fn(PublicEvent) + Send + Sync + 'static, )
pub fn get_player(&self, player_id: &str) -> Option<Rc<RefCell<Player>>>
pub fn get_active_player(&self) -> Option<Rc<RefCell<Player>>>
pub fn get_non_active_player(&self) -> Option<Rc<RefCell<Player>>>
pub fn cutt_deck( &mut self, player: Rc<RefCell<Player>>, cards_to_take: usize, ) -> Result<(), PlayerError>
pub fn draw_card_after_trick( &mut self, player: Rc<RefCell<Player>>, ) -> Result<(), PlayerError>
pub fn draw_card( &mut self, player: Rc<RefCell<Player>>, ) -> Result<(), PlayerError>
pub fn take_cards_til( &mut self, player: Rc<RefCell<Player>>, idx: usize, ) -> Result<(), PlayerError>
pub fn get_player_with_greatest_card( &self, ) -> Result<Rc<RefCell<Player>>, PlayerError>
pub fn recreate_deck(&mut self)
pub fn distribute_cards(&mut self) -> Result<(), PlayerError>
pub fn set_active_player( &mut self, player: Rc<RefCell<Player>>, ) -> Result<(), PlayerError>
pub fn play_card( &mut self, player: Rc<RefCell<Player>>, card: Card, ) -> Result<(), PlayerError>
pub fn swap_trump( &mut self, player: Rc<RefCell<Player>>, card: Card, ) -> Result<(), PlayerError>
pub fn announce_40( &mut self, player: Rc<RefCell<Player>>, ) -> Result<(), PlayerError>
pub fn announce_20( &mut self, player: Rc<RefCell<Player>>, cards: [Card; 2], ) -> Result<(), 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