-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathass1Player.h
55 lines (47 loc) · 1.02 KB
/
ass1Player.h
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
#pragma once
#include <iostream>
#include "Slot_Cosmetics.h"
using namespace std;
class Player
{
public:
Player();
~Player();
//This function automatically sets the default player chips to 2000 when nothing is assigned to it
void setPlayerChips(int c = 2000);
int getPlayerChips();
//Checks whether or not the player can continue playing
bool doesPlayerHaveChips();
//Displays players chip count
void dispChips(int playerChips);
private:
//Creating an instance of the Slot_Cosmetics class in order to use some of its functions
Slot_Cosmetics slotCos;
//Integer to store player's chips
int chips;
};
Player::Player()
{
}
Player::~Player()
{
}
void Player::setPlayerChips(int c)
{
chips = c;
}
int Player::getPlayerChips()
{
return chips;
}
bool Player::doesPlayerHaveChips()
{
return (chips > 0);
}
void Player::dispChips(int playerChips)
{
system("CLS");
slotCos.setColour(GREEN);
slotCos.tabToMiddle();
cout << "Player's chips: $" << playerChips << "\n";
}