-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpcard.cpp
More file actions
38 lines (32 loc) · 990 Bytes
/
pcard.cpp
File metadata and controls
38 lines (32 loc) · 990 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
#include "macros.h"
#include <string>
PCard::PCard() : name("Empty Constructor"), disease_id(-1), city_id(-1), event(false), epidemic(false)
{}
PCard::PCard(std::string _name, int _cid, int _did, bool _is_event, bool _is_epidemic) :
name(_name), city_id(_cid), disease_id(_did), event(_is_event), epidemic(_is_epidemic)
{}
PCard::PCard(const PCard& _copy_from)
{
name = _copy_from.name;
city_id = _copy_from.city_id;
disease_id = _copy_from.disease_id;
event = _copy_from.event;
epidemic = _copy_from.epidemic;
}
PCard& PCard::operator =(const PCard& _assign_from)
{
name = _assign_from.name;
city_id = _assign_from.city_id;
disease_id = _assign_from.disease_id;
event = _assign_from.event;
epidemic = _assign_from.epidemic;
return *this;
}
bool PCard::operator ==(const PCard& _compare)
{
if (name == _compare.name && city_id == _compare.city_id &&
event == _compare.event && epidemic == _compare.epidemic)
return true;
else
return false;
}