forked from itsJonnyJyo/Chicken-Feet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplayer.cpp
More file actions
65 lines (58 loc) · 1.01 KB
/
player.cpp
File metadata and controls
65 lines (58 loc) · 1.01 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include "player.h"
#include "hand.h"
using namespace std;
//constructor / destructor
Player::Player(){}
Player::~Player(){}
//mutator functions
bool Player::drawBone(Yard * yard)
{
Bone * aBone;
bool done = false;
if (yard->deal(aBone))
{
hand.addBone(aBone);
done = true;
}
return done;
}
bool Player::playBone(int num, Bone*& aBone)
{
return hand.removeBone(num, aBone);
}
void Player::addBone(Bone* aBone)
{
hand.addBone(aBone);
}
bool Player::highestDouble(int& pos, Bone*& aBone)
{
return hand.highestDouble(pos, aBone);
}
int Player::getTop(int pos, Bone*& aBone)
{
return hand.getTop(pos, aBone);
}
int Player::getBottom(int pos, Bone*& aBone)
{
return hand.getBottom(pos, aBone);
}
int Player::getSize() const
{
return hand.size();
}
//accessor functions
void Player::getScore() const
{
cout << "Player score: " << hand.getHandScore() << endl << endl;
}
void Player::getHand() const
{
hand.print();
cout << endl;
}
void Player::getDraw() const
{
hand.printBone();
cout << endl;
}