C++ library that simulates a deck of cards.
cdeck Card object
Instantiates the card object
cdeck::Card c("Test", 0);
Compare two Card objects. Returns the difference of self.value and other.value
cdeck::Card c("Test", 0);
cdeck::Card d("Test", 0);
//returns 0
c.compare(d);
d = cdeck::Card("Test", 1);
//returns -1
c.compare(d);
d = cdeck::Card("Test", -1);
//returns 1
c.compare(d);
returns the Card's suite
cdeck::Card c("Test", 0);
//returns "Test"
std::string suite = c.getSuite();
returns the Card's value
cdeck::Card c("Test", 0);
//returns 0
int value = c.getValue();
cdeck Deck object. Default constructor only
cdeck::Deck d;
Adds a card to the top of the stack
cdeck::Deck d;
cdeck::Card c("Test", 0);
d.add(c);
Adds a card to the bottom of the stack
d.burn(c);
Returns the current stack size
unsigned long size = d.size();
Removes and returns the item at the top of the stack
Card c1 = d.draw();
Returns the card at the top of the stack without removing it
Card c2 = d.peek();
Shuffles the deck
d.shuffle();