-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.cpp
More file actions
42 lines (32 loc) · 787 Bytes
/
Player.cpp
File metadata and controls
42 lines (32 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// Created by T Alpha 1 on 11/2/2019.
//
#include "Player.h"
Player::Player (std::string name, int score){
m_playerName = name;
m_score = score;
}
std::string Player::getPlayerName(){
return m_playerName;
}
int Player::getScore(){
return m_score;
}
void Player::setPlayerName(std::string name){
m_playerName = name;
}
void Player::setScore(int score){
m_score = score;
}
void Player::retrieveCardFfromDrawPile(Card* playerCard) {
m_drawpile.push_back(playerCard);
}
void Player::addCardFromDrawPile(Card* playerCard) {
m_playerHand.push_back(playerCard);
}
std::string Player::displayHand() {
for (int i = 0; i < m_playerHand.size(); i++){
std::cout << m_playerHand.at(i) -> getValue() << " " << m_playerHand.at(i) -> getColor()
<< std::endl;
}
}