//ctor makes a Game thingy and draws cards for players to start with public Game(Player[] players) { _playerList = players; Deck = new Deck(); 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(Deck.DrawCard()); //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 }
public Game(Player[] players) //ctor makes a Game thingy and draws cards for players to start with { _playerList = players; Deck = new Deck(); 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(Deck.DrawCard()); //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 }