daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Aug 13th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3. #include <time.h>
  4. #include "Card.h"
  5. #include "DeckOfCards.h"
  6. using namespace std;
  7.  
  8. vector<Card> deck;
  9. int currentCard = -1;
  10.  
  11. DeckOfCards::DeckOfCards()
  12. {
  13.     for(int i = 0; i < 13; i++);
  14.     {
  15.         for(int j = 0; j < 4; j++);
  16.         {
  17.             deck.push_back(Card(i, j));
  18.         }
  19.     }
  20. }
  21.  
  22. void DeckOfCards::shuffle()
  23. {
  24.     srand (time(NULL));
  25.     rand (deck.begin(), deck.end());
  26. }
  27.  
  28. Card DeckOfCards::dealCard()
  29. {
  30.     currentCard++;
  31.     return deck.at(currentCard);
  32. }
  33.  
  34. bool DeckOfCards::moreCards()
  35. {
  36.     if(currentCard < 52)
  37.     {
  38.         return true;
  39.     }
  40.     else
  41.     {
  42.         return false;
  43.     }
  44. }
RAW Paste Data
Top