Ejemplo n.º 1
0
        //ctor makes a game thingy and draws cards for players to start with
        public game(player[] players)
        {
            playerList = players;
            gameDeck = new cards();
            for (int i = 0; i < 5; i++) //5 cards per player to start
            {
                for (int j = 0; j < playerList.Length; j++) //card 1 player 1 2 3 card 2 player 1 2 3...
                {
                    playerList[j].hand.Add(gameDeck.draw(gameDeck)); //draw a new random card from deck
                    playerList[j].hand.Sort();
                }
            }
            currentPlayer = players[0]; //start with player 1

            playArea = new playarea(this); //be sure the playarea can reference the game variables, pass it along
            playArea.Show();
            playArea.roundUpdate(currentPlayer);
            //game has started, thanks ctor
        }
Ejemplo n.º 2
0
        public game(player[] players) //ctor makes a game thingy and draws cards for players to start with
        {
            playerList = players;
            gameDeck   = new cards();
            for (int i = 0; i < 5; i++)                              //5 cards per player to start
            {
                for (int j = 0; j < playerList.Length; j++)          //card 1 player 1 2 3 card 2 player 1 2 3...
                {
                    playerList[j].hand.Add(gameDeck.draw(gameDeck)); //draw a new random card from deck
                    playerList[j].hand.Sort();
                }
            }
            currentPlayer = players[0];    //start with player 1

            playArea = new playarea(this); //be sure the playarea can reference the game variables, pass it along
            playArea.Show();
            playArea.roundUpdate(currentPlayer);
            //game has started, thanks ctor
        }