/// <summary>Convert the bid to a XML string</summary> /// <returns>String</returns> public string ToXML() { string s; switch (this.special) { case SpecialBids.Pass: s = "Pass"; break; case SpecialBids.Double: s = "X"; break; case SpecialBids.Redouble: s = "XX"; break; case SpecialBids.NormalBid: s = ((int)this.level).ToString() + SuitHelper.ToXML(this.suit); break; default: return("?"); } if (this.alert) { s += "!"; } return(s); }
/// <summary>Convert the bid to a string</summary> /// <returns>String</returns> public override string ToString() { switch (this.special) { case SpecialBids.Pass: return("Pass"); case SpecialBids.Double: return("x"); case SpecialBids.Redouble: return("xx"); case SpecialBids.NormalBid: //return ((int)this.level).ToString() + (this.suit == Suits.NoTrump // ? SuitConverter.ToXML(this.suit) // : "" + SuitConverter.ToChar(this.suit)); return(((int)this.level).ToString() + SuitHelper.ToXML(this.suit)); default: return("?"); } }
private void SeatSuit2String(Seats seat, Suits suit, StringBuilder result) { result.Append(SuitHelper.ToXML(suit) + " "); int length = 0; for (Ranks rank = Ranks.Ace; rank >= Ranks.Two; rank--) { if (this.Owns(seat, suit, rank)) { result.Append(Rank.ToXML(rank)); length++; } } for (int l = length + 1; l <= 13; l++) { result.Append(" "); } }