private CardButton CreateCardButton(CardFace face, CardSuit suit) { CardButton button = new CardButton(); button.HoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); button.Selected = false; button.SelectedColor = System.Drawing.Color.Yellow; button.Size = new System.Drawing.Size(BUTTON_SIZE, BUTTON_SIZE); button.TabIndex = 0; // Make sure the suit is lower cased String value = Card.CardFaceToChar(face) + new String(Card.CardSuitToChar(suit), 1).ToLower(); button.Name = "btn" + value; button.Value = value; button.Click += new EventHandler(button_Click); return(button); }
public static string ConvertToString(CardFace firstFace, CardSuit firstSuit, CardFace secondFace, CardSuit secondSuit) { // Suited? string suited = "o"; // default to offsuit if (firstSuit == secondSuit) { suited = "s"; } // If we have a pair, it's obviously offsuit if (firstFace == secondFace) { suited = ""; } string firstFaceStr = Card.CardFaceToChar(firstFace).ToString(); string secondFaceStr = Card.CardFaceToChar(secondFace).ToString(); return(firstFaceStr + secondFaceStr + suited); }