var searchIndex = {}; searchIndex["libcoinche"] = {"doc":"Models a game of [coinche](https://en.wikipedia.org/wiki/Coinche) (a french card game).","items":[[5,"deal_hands","libcoinche","Deals cards to 4 players randomly.",null,null],[0,"cards","","This module represents a basic, rule-agnostic 32-cards system.",null,null],[3,"Suit","libcoinche::cards","One of the four Suits: Heart, Spade, Diamond, Club",null,null],[12,"0","","",0,null],[3,"Rank","","Rank of a card in a suit",null,null],[12,"0","","",1,null],[3,"Card","","Represents a single card",null,null],[12,"0","","",2,null],[3,"Hand","","Represents an unordered set of cards",null,null],[12,"0","","",3,null],[3,"Deck","","A deck of cards.",null,null],[17,"HEART","","The Heart suit",null,null],[17,"SPADE","","The Spade suit",null,null],[17,"DIAMOND","","The Diamond suit",null,null],[17,"CLUB","","The Club suit",null,null],[17,"RANK_7","","7",null,null],[17,"RANK_8","","8",null,null],[17,"RANK_9","","9",null,null],[17,"RANK_J","","Jack",null,null],[17,"RANK_Q","","Queen",null,null],[17,"RANK_K","","King",null,null],[17,"RANK_X","","10",null,null],[17,"RANK_A","","Ace",null,null],[17,"RANK_MASK","","Bit mask over all ranks",null,null],[11,"clone","","",0,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"encode","","",0,null],[11,"from_n","","Returns the suit corresponding to the number:",0,{"inputs":[{"name":"u32"}],"output":{"name":"self"}}],[11,"to_string","","Returns a UTF-8 character representing the suit.",0,null],[11,"clone","","",1,null],[11,"eq","","",1,null],[11,"ne","","",1,null],[11,"from_n","","Returns the rank corresponding to the given number:\n* `0`: 7\n* `1`: 8\n* `2`: 9\n* `3`: J\n* `4`: Q\n* `5`: K\n* `6`: X\n* `7`: A\n* `>=8`: panics",1,{"inputs":[{"name":"u32"}],"output":{"name":"self"}}],[11,"to_string","","Returns a character representing the given rank",1,null],[11,"clone","","",2,null],[11,"eq","","",2,null],[11,"ne","","",2,null],[11,"encode","","",2,null],[11,"id","","Returns the card number (from 0 to 31)",2,null],[11,"from_id","","Returns the card corresponding to the given number",2,{"inputs":[{"name":"u32"}],"output":{"name":"self"}}],[11,"rank","","Returns the card's rank",2,null],[11,"suit","","Returns the card's suit",2,null],[11,"to_string","","Returns a string representation of the card",2,null],[11,"new","","Creates a card from the given suit and rank",2,{"inputs":[{"name":"suit"},{"name":"rank"}],"output":{"name":"self"}}],[11,"clone","","",3,null],[11,"eq","","",3,null],[11,"ne","","",3,null],[11,"encode","","",3,null],[11,"new","","Returns an empty hand.",3,{"inputs":[],"output":{"name":"self"}}],[11,"add","","Add `card` to `self`.",3,null],[11,"remove","","Removes `card` from `self`.",3,null],[11,"clean","","Remove all cards from `self`.",3,null],[11,"has","","Returns `true` if `self` contains `card`.",3,null],[11,"has_any","","Returns `true` if the hand contains any card of the given suit.",3,null],[11,"is_empty","","Returns `true` if `self` contains no card.",3,null],[11,"get_card","","Returns a card from `self`.",3,null],[11,"list","","Returns the cards contained in `self` as a `Vec`.",3,null],[11,"size","","Returns the number of cards in `self`.",3,null],[11,"to_string","","Returns a string representation of `self`.",3,null],[11,"new","","Returns a full, sorted deck of 32 cards.",4,{"inputs":[],"output":{"name":"self"}}],[11,"shuffle","","Shuffle this deck.",4,null],[11,"draw","","Draw the top card from the deck.",4,null],[11,"is_empty","","Returns `true` if this deck is empty.",4,null],[11,"len","","Returns the number of cards left in this deck.",4,null],[11,"deal_each","","Deal `n` cards to each hand.",4,null],[11,"to_string","","",4,null],[0,"bid","libcoinche","Auctions and bidding during the first phase of the game.",null,null],[3,"Contract","libcoinche::bid","Contract taken by a team.",null,null],[12,"author","","Initial author of the contract.",5,null],[12,"trump","","Trump suit for this game.",5,null],[12,"target","","Target for the contract.",5,null],[12,"coinche_level","","Level of coinche:",5,null],[3,"Auction","","Represents the entire auction process.",null,null],[4,"Target","","Goal set by a contract.",null,null],[13,"Contract80","","Team must get 80 points",6,null],[13,"Contract90","","Team must get 90 points",6,null],[13,"Contract100","","Team must get 100 points",6,null],[13,"Contract110","","Team must get 110 points",6,null],[13,"Contract120","","Team must get 120 points",6,null],[13,"Contract130","","Team must get 130 points",6,null],[13,"Contract140","","Team must get 140 points",6,null],[13,"Contract150","","Team must get 150 points",6,null],[13,"Contract160","","Team must get 160 points",6,null],[13,"ContractCapot","","Team must win all tricks",6,null],[4,"AuctionState","","Current state of an auction",null,null],[13,"Bidding","","Players are still bidding for the highest contract",7,null],[13,"Coinching","","One player coinched, maybe another one will surcoinche?",7,null],[13,"Over","","Auction is over, game will begin",7,null],[13,"Cancelled","","No contract was taken, a new game will start",7,null],[4,"BidError","","Possible error occuring during an Auction.",null,null],[13,"AuctionClosed","","The auction was closed and does not accept more contracts.",8,null],[13,"TurnError","","A player tried bidding before his turn.",8,null],[13,"NonRaisedTarget","","The given bid was not higher than the previous one.",8,null],[13,"AuctionRunning","","Cannot complete the auction when it is still running.",8,null],[13,"NoContract","","No contract was offered during the auction, it cannot complete.",8,null],[13,"OverCoinche","","The contract was coinched too many times.",8,null],[11,"clone","","",6,null],[11,"eq","","",6,null],[11,"encode","","",6,null],[11,"score","","Returns the score this target would give on success.",6,null],[11,"victory","","Determines whether this target was reached.",6,null],[11,"from_str","","",6,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"encode","","",5,null],[11,"clone","","",5,null],[11,"fmt","","",7,null],[11,"clone","","",7,null],[11,"eq","","",7,null],[11,"new","","Starts a new auction, starting with the player `first`.",9,{"inputs":[{"name":"playerpos"}],"output":{"name":"self"}}],[11,"fmt","","",8,null],[11,"eq","","",8,null],[11,"fmt","","",8,null],[11,"get_state","","Returns the current state of the auctions.",9,null],[11,"next_player","","Returns the player that is expected to play next.",9,null],[11,"bid","","Bid a new, higher contract.",9,null],[11,"current_contract","","Look at the last offered contract.",9,null],[11,"hands","","Returns the players cards.",9,null],[11,"pass","","The current player passes his turn.",9,null],[11,"coinche","","Attempt to coinche the current contract.",9,null],[11,"complete","","Consumes a complete auction to enter the second game phase.",9,null],[0,"game","libcoinche","Module for the card game, after auctions are complete.",null,null],[3,"GameState","libcoinche::game","",null,null],[4,"GameResult","","",null,null],[13,"Nothing","","",10,null],[13,"GameOver","","",10,null],[4,"TrickResult","","",null,null],[13,"Nothing","","",11,null],[13,"TrickOver","","",11,null],[4,"PlayError","","",null,null],[13,"TurnError","","",12,null],[13,"CardMissing","","",12,null],[13,"IncorrectSuit","","",12,null],[13,"InvalidPiss","","",12,null],[13,"NonRaisedTrump","","",12,null],[13,"NoLastTrick","","",12,null],[5,"new_game","","",null,null],[11,"fmt","","",10,null],[11,"eq","","",10,null],[11,"ne","","",10,null],[11,"fmt","","",11,null],[11,"eq","","",11,null],[11,"ne","","",11,null],[11,"fmt","","",12,null],[11,"eq","","",12,null],[11,"fmt","","",12,null],[11,"contract","","",13,null],[11,"play_card","","",13,null],[11,"hands","","",13,null],[11,"can_play","","",13,null],[11,"last_trick","","",13,null],[11,"current_trick","","",13,null],[0,"points","libcoinche","Manage score and scores",null,null],[5,"score","libcoinche::points","Returns the number of score `card` is worth, with the current trump suit.",null,{"inputs":[{"name":"card"},{"name":"suit"}],"output":{"name":"i32"}}],[5,"strength","","Returns the strength of `card`, with the current trump suit.",null,{"inputs":[{"name":"card"},{"name":"suit"}],"output":{"name":"i32"}}],[5,"trump_score","","Returns the score for the given rank when it is the trump.",null,{"inputs":[{"name":"rank"}],"output":{"name":"i32"}}],[5,"usual_score","","Returns the score for the given rank when it is not the trump.",null,{"inputs":[{"name":"rank"}],"output":{"name":"i32"}}],[5,"trump_strength","","Returns the strength for the given rank when it is the trump.",null,{"inputs":[{"name":"rank"}],"output":{"name":"i32"}}],[5,"usual_strength","","Returns the strength for the given rank when it is not the trump.",null,{"inputs":[{"name":"rank"}],"output":{"name":"i32"}}],[0,"trick","libcoinche","This module implements a trick in a game of coinchet vec",null,null],[3,"Trick","libcoinche::trick","",null,null],[12,"cards","","",14,null],[12,"first","","",14,null],[12,"winner","","",14,null],[5,"empty_trick","","",null,{"inputs":[{"name":"playerpos"}],"output":{"name":"trick"}}],[11,"encode","","",14,null],[11,"clone","","",14,null],[11,"score","","",14,null],[11,"winner","","",14,null],[11,"play_card","","",14,null],[0,"pos","libcoinche","Player position in the table",null,null],[3,"Team","libcoinche::pos","One of two teams",null,null],[12,"0","","",15,null],[3,"PlayerPos","","A position in the table",null,null],[12,"0","","",16,null],[3,"PlayerIterator","","Iterates on players",null,null],[17,"P0","","Player 0",null,null],[17,"P1","","Player 1",null,null],[17,"P2","","Player 2",null,null],[17,"P3","","Player 3",null,null],[11,"fmt","","",15,null],[11,"clone","","",15,null],[11,"eq","","",15,null],[11,"ne","","",15,null],[11,"encode","","",15,null],[11,"opponent","","Returns the other team",15,null],[11,"fmt","","",16,null],[11,"clone","","",16,null],[11,"eq","","",16,null],[11,"ne","","",16,null],[11,"encode","","",16,null],[11,"next","","",17,null],[11,"team","","Returns the player's team",16,null],[11,"is_partner","","Returns `true` if `self` and `other` and in the same team",16,null],[11,"next","","Returns the next player in line",16,null],[11,"next_n","","Returns the player `n` seats further",16,null],[11,"prev","","Returns the previous player.",16,null],[11,"until_n","","Returns an iterator that iterates on `n` players, including this one.",16,null],[11,"distance_until","","Returns the number of turns after `self` to reach `other`.",16,null],[11,"until","","Returns an iterator until the given player (`self` included, `other` excluded)",16,null]],"paths":[[3,"Suit"],[3,"Rank"],[3,"Card"],[3,"Hand"],[3,"Deck"],[3,"Contract"],[4,"Target"],[4,"AuctionState"],[4,"BidError"],[3,"Auction"],[4,"GameResult"],[4,"TrickResult"],[4,"PlayError"],[3,"GameState"],[3,"Trick"],[3,"Team"],[3,"PlayerPos"],[3,"PlayerIterator"]]}; initSearch(searchIndex);