Advertisement
Guest User

game

a guest
Nov 24th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. /* Check if played card in player 1's hand */
  2.  
  3.     // !!!!!!!!!!!!!!!!
  4.     // bug where rank is undefined for some reason??? //
  5.     // !!!!!!!!!!!!!!!!
  6.     card topcard = holderContainer.accessPoppedData()->getTopCard();
  7.  
  8.     cout << topcard.getRankAsString() << endl;
  9.     cout << topcard.getSuitAsString() << endl;
  10.  
  11.  
  12.     cardDeck *p1Deck = player1Container.accessPoppedData();
  13.     //
  14.     bool found = false;
  15.  
  16.     cout << " Print card in players hand" << endl;
  17.     card cardToAdd = p1Deck->getCard(topcard, found);
  18.  
  19.     if (found == true)
  20.     {
  21.       cout << "Player 1 has a matching card!" << endl;
  22.       cout << cardToAdd.getRankAsString() << endl;
  23.       cout << cardToAdd.getSuitAsString() << endl;
  24.  
  25.       // remove card from players deck and add to played cards deck
  26.  
  27.       // check size of player 1's deck, if 0 = p1 wins else move to p2
  28.     }
  29.     else
  30.     {
  31.       cout << "Player 1 has no matching cards" << endl;
  32.       cout << "Player 1 draws a card" << endl;
  33.  
  34.       // add card from container deck to player 1 deck
  35.     }
  36.  
  37.     /* similar code to above for player 2 */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement