示例#1
0
 public void start()
 {
     Dealer = new Player("Dealer");
     Player1 = new Player("Player One");
     Deck = new PlayingCardDeck();
     
 }
示例#2
0
 private bool isSameDeck(Deck d1, Deck d2)
 {
     int size = d1.Count;
     int sameCardCount = 0;
     for(int i=0; i<size;i++)
     {
         Card card1 = d1.dealCard();
         Card card2 = d2.dealCard();
         if (card1.Equals(card2)) sameCardCount++;
     }
     if (sameCardCount == size) return true;
     return false;
 }
示例#3
0
 public Player(String name="default name")
 {
     Name = name;
     Hand = new Deck();
 }
示例#4
0
 private bool isDeckShuffled(Deck deck)
 {
     Deck unshuffled = new PlayingCardDeck();
     return !isSameDeck(deck, unshuffled);
 }
示例#5
0
 public void dealingFromEmptyDeckThrowsException()
 {
     Deck emptyDeck = new Deck();
     emptyDeck.dealCard();
 }
示例#6
0
 public void createPlayingCardDeck()
 {
     deck = new PlayingCardDeck();
 }