-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPlayer.cpp
More file actions
40 lines (39 loc) · 754 Bytes
/
Player.cpp
File metadata and controls
40 lines (39 loc) · 754 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
/*
Group Member1: Malik Talha Saeed - 19I-0413(D)
Group Member2: Hammad Ahmed - 19I-0582(D)
*/
#include "Player.h"
Token* Player::getToken(int tokenNum)
{
if(tokenNum <= this->totalTokens)
{
return &this->tokens[tokenNum - 1];
}
std::cout << "Invalid Token Number!" << std::endl;
return NULL;
}
void Player::incHitCount()
{
this->hitCount++;
}
int Player::getHitCount()const
{
return this->hitCount;
}
int Player::getTotalTokens()const
{
return this->totalTokens;
}
void Player::rollDice(int index)
{
diceValue[index] = (rand()%6 + 1);
}
void Player::resetDiceValues()
{
for(int i = 0; i < 3; i++)
diceValue[i] = 0;
}
int* Player::getDiceValues()
{
return this->diceValue;
}