コード例 #1
0
 //Begins a new game and returns the winner
 public Player PlayGame()
 {
     player.hand = new Hand(maxCardsInHand);
     house.hand  = new Hand(maxCardsInHand);
     if (currentDeck.deckCount < minCardsNeeded)
     {
         currentDeck = new Poker.Deck();
     }
     for (int i = 0; i < maxCardsInHand; i++)
     {
         currentDeck.dealCard(player);
         currentDeck.dealCard(house);
     }
     if (house.hand.getValue() > player.hand.getValue())
     {
         return(house);
     }
     else
     {
         return(player);
     }
 }