public void distribute(Player[] players, int startPlayer) { int cur = startPlayer; foreach (Card card in cards) { players[cur].giveCard(card); cur = (cur + 1) % players.Length; } }
public GameState(Player[] players, int turnIndex, Card[] trick, Suit leadSuit, int cardsPlayedInTrick) { this.players = new Player[4]; for (int i = 0; i < 4; i++) { this.players[i] = players[i].clone(); } this.turnIndex = turnIndex; this.trick = trick; this.leadSuit = leadSuit; this.cardsPlayedInTrick = cardsPlayedInTrick; }
public GameState() { players = new Player[4]; for (int i = 0; i < 4; i++) players[i] = new Player(i); Deck deck = new Deck(); deck.distribute(players, 0); turnIndex = getFirstPlayer(); trick = new Card[4]; leadSuit = Suit.None; cardsPlayedInTrick = 0; }