-
Notifications
You must be signed in to change notification settings - Fork 0
/
card.cpp
52 lines (41 loc) · 759 Bytes
/
card.cpp
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
#include <iostream>
#include "card.h"
using namespace std;
Card::Card()
{
}
Card::Card(Face face, Suite suite)
{
this->face = face;
this->suite = suite;
}
bool Card::isRed()
{
return (this->suite == Suite::HEARTS || this->suite == Suite::DIAMONDS);
}
void Card::print()
{
cout << "\nPrinter:" << this->toReadableString() << endl;
}
std::string Card::toReadableString()
{
string suite = Suites::SuiteNames[(int)this->suite];
string face = Faces::FaceNames[(int)this->face];
return "Card: " + face + " : " + suite;
}
Face Card::getFace()
{
return face;
}
void Card::setFace(Face face)
{
this->face = face;
}
Suite Card::getSuite()
{
return suite;
}
void Card::setSuite(Suite suite)
{
this->suite = suite;
}