Struct libcoinche::bid::Auction
source · [−]pub struct Auction { /* private fields */ }
Expand description
Represents the entire auction process.
Implementations
sourceimpl Auction
impl Auction
sourcepub fn get_state(&self) -> AuctionState
pub fn get_state(&self) -> AuctionState
Returns the current state of the auctions.
sourcepub fn next_player(&self) -> PlayerPos
pub fn next_player(&self) -> PlayerPos
Returns the player that is expected to play next.
sourcepub fn bid(
&mut self,
pos: PlayerPos,
trump: Suit,
target: Target
) -> Result<AuctionState, BidError>
pub fn bid(
&mut self,
pos: PlayerPos,
trump: Suit,
target: Target
) -> Result<AuctionState, BidError>
Bid a new, higher contract.
sourcepub fn current_contract(&self) -> Option<&Contract>
pub fn current_contract(&self) -> Option<&Contract>
Look at the last offered contract.
Returns None
if no contract was offered yet.
sourcepub fn pass(&mut self, pos: PlayerPos) -> Result<AuctionState, BidError>
pub fn pass(&mut self, pos: PlayerPos) -> Result<AuctionState, BidError>
The current player passes his turn.
Returns the new auction state :
AuctionState::Cancelled
if all players passedAuctionState::Over
if 3 players passed in a row- The previous state otherwise
Auto Trait Implementations
impl RefUnwindSafe for Auction
impl Send for Auction
impl Sync for Auction
impl Unpin for Auction
impl UnwindSafe for Auction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more