Blackjack++
  Card class  

Card class


void draw(BITMAP* buf,int x,int y,bool facedown)

Public function.
Draws the card on the given bitmap at the x,y location, and if facedown is false, also displays the card details on it.

int value()

Public function.
Returns a value of 1-10, giving the cardID's value.
The values are Blackjack-specific, in that Ace is 1, 2-10 are 2-10, and Face cards are all 10.
Checking for Ace counting as 11 is done in Player::value()

char suit()

Public function.
Returns the char corresponding to the suit of the card.
S: Spades, H: Hearts, C: Clubs, D: Diamonds If the card is above cardID 52, Returns X

std::string desc()

Public function.
Returns the descriptor of the card as a std::string.
A: Ace, J: Jack, Q: Queen, K: King
2-10 use their respective numbers.

void setID(int pcid)

Public function.
Used to change the card ID after it has been instantiated.

Card(int pcid)

Public constructor.
Takes an int pcid corresponding to the card ID (1-52).

~Card()

Default destructor. No explicit function.
Stephen Cole - Pitt Community College - December 2006