/// <summary> /// Plaies the check. /// </summary> /// <returns><c>true</c>, if check was played, <c>false</c> otherwise.</returns> /// <param name="board">Board.</param> /// <param name="n">N.</param> /// <param name="contract">Contract.</param> private bool playCheck(List <Card> board, int n, Contract contract) { try { cards.ElementAt(n); if (board.Count == 0) { return(true); } if (cards.ElementAt(n).getColor() == board.ElementAt(0).getColor()) { return(true); } if (board.ElementAt(0).doYouHaveSuit(cards)) { return(false); } if (cards.ElementAt(n).getColor() == contract.getColor()) { return(true); } Card card = new Card(contract.getColor(), Value.ACE); return(!card.doYouHaveSuit(cards)); } catch (Exception) { GameManager.SendPrivate(this, "Out of range!"); return(false); } }
private bool playCheck(List <Card> board, int n, Bid bid) { try { cards.ElementAt(n); if (board.Count == 0) { return(true); } if (cards.ElementAt(n).getSuit() == board.ElementAt(0).getSuit()) { return(true); } if (board.ElementAt(0).doYouHaveSuit(cards)) { return(false); } if (cards.ElementAt(n).getSuit() == bid.getSuit()) { /*if (cards.elementAt(n).isItBiggest(board, true)) * return true; * else * return (!cards.elementAt(n).isItBiggest(cards, true));*/ return(true); } Card card = new Card(bid.getSuit(), Value.ACE); return(!card.doYouHaveSuit(cards)); } catch (Exception) { Network.SendPrivate(this, "Out of range!"); return(false); } }