#include "player.h" Player::Player (Deck & aDeck) // initialize the data fields for a player { myScore = 0; for (int i = 0; i < 3; i++) myCards[i] = aDeck.draw(); removedCard = 0; } Card Player::draw ( ) // return a random card from our hand { removedCard = rand() % 3; return myCards[removedCard]; } void Player::addPoints (int howMany) // add the given number of points to the current score { myScore += howMany; } int Player::score ( ) // return the current score { return myScore; } void Player::replaceCard (Deck & aDeck) // replace last card played with new card { myCards[removedCard] = aDeck.draw(); }