public Card(int v, int s) { CardList list = new CardList(); Value = list.ValueList[v]; Suit = list.SuitList[s]; }
public int CompareTo(Card other) { CardList list = new CardList(); int valueResult = Array.IndexOf(list.ValueList, Value) - Array.IndexOf(list.ValueList, other.Value); if (valueResult == 0) { return(Array.IndexOf(list.SuitList, Suit) - Array.IndexOf(list.SuitList, other.Suit)); } return(valueResult); }
private static List <Card> GetTestData(int numCards) { List <Card> cardSet = new List <Card>(); Random random = new Random(); CardList list = new CardList(); if (numCards < 0) { numCards = 0; } for (int i = 0; i < numCards; i++) { int v = random.Next(list.ValueList.Length); int s = random.Next(list.SuitList.Length); Card card = new Card(v, s); cardSet.Add(card); } return(cardSet); }