private static void AppendSuit(StringBuilder html, Suit suit, Hand hand) { html.Append("<div class=\"holding\">"); html.Append(HTMLSuitMapper.GetstringFromSuit(suit)); if (hand != null) { List <Card> cards = hand.GetCardsWithinSuit(suit); if (cards != null) { foreach (Card c in cards) { html.Append(' '); html.Append(PBNDenominationMapper .GetCharFromDenomination(c.Denomination)); } } } html.Append("</div>"); }
private static void AppendCall(StringBuilder html, Bid bid) { if (bid.Pass) { html.Append("Pass"); } else if (bid.ReDouble) { html.Append("XX"); } else if (bid.Double) { html.Append("X"); } else { html.Append(bid.Level.ToString() + HTMLSuitMapper.GetstringFromSuit(bid.Suit)); } }
public static string GetstringFromContract(Contract contract) { if (contract == null) { return(""); } if (contract.Level == 0) { return("Pass"); } var ret = new StringBuilder(); ret.Append(contract.Level); ret.Append(HTMLSuitMapper.GetstringFromSuit(contract.Suit)); if (contract.ReDoubled) { ret.Append("XX"); } else if (contract.Doubled) { ret.Append("X"); } return(ret.ToString()); }