-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.cpp
More file actions
53 lines (46 loc) · 842 Bytes
/
Copy pathCard.cpp
File metadata and controls
53 lines (46 loc) · 842 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
43
44
45
46
47
48
49
50
51
#include "Card.h"
#include <iostream>
using namespace std;
Card::Card(char type, int number)
{
this->type = type;
this->number = number;
};
Card::Card(const Card& card1)
{
this->type = card1.getType();
this->number = card1.getNumber();
};
Card& Card::operator=(const Card& card1)
{
this->type = card1.getType();
this->number = card1.getNumber();
return *this;
};
bool Card::operator==(const Card& card1)
{
// Used if we need to check if two cards are equal to each other
if (card1.getNumber() == this->number)
return true;
return false;
};
void Card::setType(char type1)
{
this->type = type1;
};
void Card::setNumber(int num1)
{
this->number = num1;
};
char Card::getType() const
{
return this->type;
};
int Card::getNumber() const
{
return this->number;
};
void Card::print()
{
cout << type << number << " ";
}