示例#1
0
        public void distribute(Player[] players, int startPlayer)
        {
            int cur = startPlayer;

            foreach (Card card in cards)
            {
                players[cur].giveCard(card);
                cur = (cur + 1) % players.Length;
            }
        }
示例#2
0
 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;
 }
示例#3
0
        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;
        }