/// <summary> /// Wypelnia strukturę kontrakt na podstawie stringu. /// </summary> /// <param name="input">Kontrakt w formie tekstowej np. 2HS=, 2HSx-1</param> public Contract(string input) { if (input == "P") { level = 0; contract_str = "pass"; } //jesli kontrakt inny niz 4 pasy else { level = int.Parse(input[0].ToString()); suit = ConvertSuit(input[1]); declarer = ConvertPosition(input[2]); contract_str = level.ToString() + suit.ToString().ToUpper()[0]; // sprawdzenie kontr i rekontr int iter = 3; if (input[iter] == 'x') { dbl = true; contract_str += "x"; iter++; if (input[iter] == 'x') { rdbl = true; contract_str += "x"; iter++; } } if (input[iter] == '-') { tricks = -int.Parse(input[++iter].ToString()); } else { if (input[iter] != '=') { tricks = int.Parse(input[++iter].ToString()); } } } }
public Card(suits suits, numerical numerical) { this.suits = suits.ToString(); this.numerical = numerical.ToString(); }
public override string ToString() { return(value.ToString() + " of " + suit.ToString()); }