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","Quick method to get cards for 4 players.",null,null],[5,"deal_seeded_hands","","Deal cards for 4 players deterministically.",null,null],[0,"bid","","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.",0,null],[12,"trump","","Trump suit for this game.",0,null],[12,"target","","Target for the contract.",0,null],[12,"coinche_level","","Level of coinche:",0,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",1,null],[13,"Contract90","","Team must get 90 points",1,null],[13,"Contract100","","Team must get 100 points",1,null],[13,"Contract110","","Team must get 110 points",1,null],[13,"Contract120","","Team must get 120 points",1,null],[13,"Contract130","","Team must get 130 points",1,null],[13,"Contract140","","Team must get 140 points",1,null],[13,"Contract150","","Team must get 150 points",1,null],[13,"Contract160","","Team must get 160 points",1,null],[13,"ContractCapot","","Team must win all tricks",1,null],[4,"AuctionState","","Current state of an auction",null,null],[13,"Bidding","","Players are still bidding for the highest contract",2,null],[13,"Coinching","","One player coinched, maybe another one will surcoinche?",2,null],[13,"Over","","Auction is over, game will begin",2,null],[13,"Cancelled","","No contract was taken, a new game will start",2,null],[4,"BidError","","Possible error occuring during an Auction.",null,null],[13,"AuctionClosed","","The auction was closed and does not accept more contracts.",3,null],[13,"TurnError","","A player tried bidding before his turn.",3,null],[13,"NonRaisedTarget","","The given bid was not higher than the previous one.",3,null],[13,"AuctionRunning","","Cannot complete the auction when it is still running.",3,null],[13,"NoContract","","No contract was offered during the auction, it cannot complete.",3,null],[13,"OverCoinche","","The contract was coinched too many times.",3,null],[11,"fmt","","",1,null],[11,"clone","","",1,null],[11,"eq","","",1,null],[11,"encode","","",1,null],[11,"decode","","",1,{"inputs":[{"name":"d"}],"output":{"name":"result"}}],[11,"score","","Returns the score this target would give on success.",1,null],[11,"to_str","","",1,null],[11,"victory","","Determines whether this target was reached.",1,null],[11,"from_str","","",1,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"to_string","","",1,null],[11,"decode","","",0,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"encode","","",0,null],[11,"fmt","","",0,null],[11,"clone","","",0,null],[11,"fmt","","",2,null],[11,"clone","","",2,null],[11,"eq","","",2,null],[11,"fmt","","",3,null],[11,"eq","","",3,null],[11,"fmt","","",3,null],[11,"new","","Starts a new auction, starting with the player `first`.",4,{"inputs":[{"name":"playerpos"}],"output":{"name":"self"}}],[11,"get_state","","Returns the current state of the auctions.",4,null],[11,"next_player","","Returns the player that is expected to play next.",4,null],[11,"bid","","Bid a new, higher contract.",4,null],[11,"current_contract","","Look at the last offered contract.",4,null],[11,"hands","","Returns the players cards.",4,null],[11,"pass","","The current player passes his turn.",4,null],[11,"coinche","","Attempt to coinche the current contract.",4,null],[11,"complete","","Consumes a complete auction to enter the second game phase.",4,null],[0,"cards","libcoinche","This module represents a basic, rule-agnostic 32-cards system.",null,null],[3,"Card","libcoinche::cards","Represents a single card.",null,null],[3,"Hand","","Represents an unordered set of cards",null,null],[3,"Deck","","A deck of cards.",null,null],[4,"Suit","","One of the four Suits: Heart, Spade, Diamond, Club.",null,null],[13,"Heart","","",5,null],[13,"Spade","","",5,null],[13,"Diamond","","",5,null],[13,"Club","","",5,null],[4,"Rank","","Rank of a card in a suit.",null,null],[13,"Rank7","","",6,null],[13,"Rank8","","",6,null],[13,"Rank9","","",6,null],[13,"RankJ","","",6,null],[13,"RankQ","","",6,null],[13,"RankK","","",6,null],[13,"RankX","","",6,null],[13,"RankA","","",6,null],[11,"fmt","","",5,null],[11,"clone","","",5,null],[11,"eq","","",5,null],[11,"encode","","",5,null],[11,"decode","","",5,{"inputs":[{"name":"d"}],"output":{"name":"result"}}],[11,"from_n","","Returns the suit corresponding to the number:",5,{"inputs":[{"name":"u32"}],"output":{"name":"self"}}],[11,"to_string","","Returns a UTF-8 character representing the suit.",5,null],[11,"from_str","","",5,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"fmt","","",6,null],[11,"clone","","",6,null],[11,"eq","","",6,null],[11,"from_n","","Returns the rank corresponding to the given number:",6,{"inputs":[{"name":"u32"}],"output":{"name":"self"}}],[11,"to_string","","Returns a character representing the given rank.",6,null],[11,"fmt","","",7,null],[11,"clone","","",7,null],[11,"eq","","",7,null],[11,"ne","","",7,null],[11,"encode","","",7,null],[11,"decode","","",7,{"inputs":[{"name":"d"}],"output":{"name":"result"}}],[11,"id","","Returns the card number (from 0 to 31)",7,null],[11,"from_id","","Returns the card corresponding to the given number.",7,{"inputs":[{"name":"u32"}],"output":{"name":"self"}}],[11,"rank","","Returns the card's rank",7,null],[11,"suit","","Returns the card's suit.",7,null],[11,"to_string","","Returns a string representation of the card.",7,null],[11,"new","","Creates a card from the given suit and rank",7,{"inputs":[{"name":"suit"},{"name":"rank"}],"output":{"name":"self"}}],[11,"fmt","","",8,null],[11,"clone","","",8,null],[11,"eq","","",8,null],[11,"ne","","",8,null],[11,"encode","","",8,null],[11,"decode","","",8,{"inputs":[{"name":"d"}],"output":{"name":"result"}}],[11,"new","","Returns an empty hand.",8,{"inputs":[],"output":{"name":"self"}}],[11,"add","","Add `card` to `self`.",8,null],[11,"remove","","Removes `card` from `self`.",8,null],[11,"clean","","Remove all cards from `self`.",8,null],[11,"has","","Returns `true` if `self` contains `card`.",8,null],[11,"has_any","","Returns `true` if the hand contains any card of the given suit.",8,null],[11,"is_empty","","Returns `true` if `self` contains no card.",8,null],[11,"get_card","","Returns a card from `self`.",8,null],[11,"list","","Returns the cards contained in `self` as a `Vec`.",8,null],[11,"size","","Returns the number of cards in `self`.",8,null],[11,"to_string","","Returns a string representation of `self`.",8,null],[11,"new","","Returns a full, sorted deck of 32 cards.",9,{"inputs":[],"output":{"name":"self"}}],[11,"shuffle","","Shuffle this deck.",9,null],[11,"shuffle_seeded","","Shuffle this deck with the given random seed.",9,null],[11,"draw","","Draw the top card from the deck.",9,null],[11,"is_empty","","Returns `true` if this deck is empty.",9,null],[11,"len","","Returns the number of cards left in this deck.",9,null],[11,"deal_each","","Deal `n` cards to each hand.",9,null],[11,"to_string","","",9,null],[0,"game","libcoinche","Module for the card game, after auctions are complete.",null,null],[3,"GameState","libcoinche::game","Describes the state of a coinche game, ready to play a card.",null,null],[4,"GameResult","","Result of a game.",null,null],[13,"Nothing","","The game is still playing",10,null],[13,"GameOver","","The game is over",10,null],[12,"points","libcoinche::game::GameResult","Worth of won tricks",10,null],[12,"winners","","Winning team",10,null],[12,"scores","","Score for this game",10,null],[4,"TrickResult","libcoinche::game","Result of a trick",null,null],[13,"Nothing","","",11,null],[13,"TrickOver","","",11,null],[4,"PlayError","","Error that can occur during play",null,null],[13,"TurnError","","A player tried to act before his turn",12,null],[13,"CardMissing","","A player tried to play a card he doesn't have",12,null],[13,"IncorrectSuit","","A player tried to play the wrong suit, while he still have some",12,null],[13,"InvalidPiss","","A player tried to play the wrong suit, while he still have trumps",12,null],[13,"NonRaisedTrump","","A player did not raise on the last played trump",12,null],[13,"NoLastTrick","","No last trick is available for display",12,null],[5,"can_play","","Returns `true` if the move appear legal.",null,{"inputs":[{"name":"playerpos"},{"name":"card"},{"name":"hand"},{"name":"trick"},{"name":"suit"}],"output":{"name":"result"}}],[11,"clone","","",13,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,"new","","Creates a new GameState, with the given cards, first player and contract.",13,null],[11,"contract","","Returns the contract used for this game",13,null],[11,"play_card","","Try to play a card",13,null],[11,"next_player","","Returns the player expected to play next.",13,null],[11,"hands","","Returns the cards of all players",13,null],[11,"last_trick","","Return the last trick, if possible",13,null],[11,"current_trick","","Returns the 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,"pos","libcoinche","Player position in the table",null,null],[3,"PlayerIterator","libcoinche::pos","Iterates on players",null,null],[4,"Team","","One of two teams",null,null],[13,"T02","","Players P0 and P2",14,null],[13,"T13","","Players P1 and P3",14,null],[4,"PlayerPos","","A position in the table",null,null],[13,"P0","","Player 0",15,null],[13,"P1","","Player 1",15,null],[13,"P2","","Player 2",15,null],[13,"P3","","Player 3",15,null],[11,"encode","","",14,null],[11,"decode","","",14,{"inputs":[{"name":"__d"}],"output":{"name":"result"}}],[11,"fmt","","",14,null],[11,"clone","","",14,null],[11,"eq","","",14,null],[11,"from_n","","Return the team corresponding to the given number.",14,{"inputs":[{"name":"usize"}],"output":{"name":"self"}}],[11,"opponent","","Returns the other team",14,null],[11,"fmt","","",15,null],[11,"clone","","",15,null],[11,"eq","","",15,null],[11,"encode","","",15,null],[11,"decode","","",15,{"inputs":[{"name":"d"}],"output":{"name":"result"}}],[11,"next","","",16,null],[11,"team","","Returns the player's team",15,null],[11,"from_n","","Returns the position corresponding to the number (0 => P0, ...).",15,{"inputs":[{"name":"usize"}],"output":{"name":"self"}}],[11,"is_partner","","Returns `true` if `self` and `other` and in the same team",15,null],[11,"next","","Returns the next player in line",15,null],[11,"next_n","","Returns the player `n` seats further",15,null],[11,"prev","","Returns the previous player.",15,null],[11,"until_n","","Returns an iterator that iterates on `n` players, including this one.",15,null],[11,"distance_until","","Returns the number of turns after `self` to reach `other`.",15,null],[11,"until","","Returns an iterator until the given player (`self` included, `other` excluded)",15,null],[0,"trick","libcoinche","This module implements a trick in a game of coinchet vec",null,null],[3,"Trick","libcoinche::trick","The current cards on the table",null,null],[12,"cards","","Cards currently on the table (they are invalid until played).",17,null],[12,"first","","First player in this trick.",17,null],[12,"winner","","Current winner of the trick (updated after each card).",17,null],[11,"fmt","","",17,null],[11,"encode","","",17,null],[11,"clone","","",17,null],[11,"new","","Creates a new, empty trick.",17,{"inputs":[{"name":"playerpos"}],"output":{"name":"self"}}],[11,"score","","Returns the points value of this trick",17,null],[11,"play_card","","Plays a card.",17,null],[11,"suit","","Returns the starting suit for this trick.",17,null]],"paths":[[3,"Contract"],[4,"Target"],[4,"AuctionState"],[4,"BidError"],[3,"Auction"],[4,"Suit"],[4,"Rank"],[3,"Card"],[3,"Hand"],[3,"Deck"],[4,"GameResult"],[4,"TrickResult"],[4,"PlayError"],[3,"GameState"],[4,"Team"],[4,"PlayerPos"],[3,"PlayerIterator"],[3,"Trick"]]}; initSearch(searchIndex);