public Deal(string format) { playedCards = new LinkedList <Card>(); lastTrick = new LinkedList <Card>(); string[] data = format.Split(" "); id = int.Parse(data[0]); deck = new Deck(data[1]); int idx = 0; foreach (string s in data[2].Split(".")) { if (s == "") { continue; } playedCards.AddLast(deck.cards[int.Parse(s)]); if (idx + (data[2].Split(".").Length % 4) >= data[2].Split(".").Length) { lastTrick.AddLast(deck.cards[int.Parse(s)]); } idx++; } bidding = new Bidding(data[3]); contract = bidding.getContract(id); string[] ints = data[4].Split("."); NSTricks = int.Parse(ints[0]); EWTricks = int.Parse(ints[1]); setPlayerOnTurn(int.Parse(ints[2])); }
public Deal(int id) { deck = new Deck(); this.id = id; bidding = new Bidding(); playedCards = new LinkedList <Card>(); lastTrick = new LinkedList <Card>(); NSTricks = 0; EWTricks = 0; setPlayerOnTurn((id - 1) % 4); }