-
Notifications
You must be signed in to change notification settings - Fork 0
/
characterdata.cpp
48 lines (38 loc) · 973 Bytes
/
characterdata.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
#include "characterdata.h"
CCharacterData::CCharacterData(QString &name) :
_name(name),
_gender(Gender::female)
{
}
CCharacterData::CCharacterData(QString &name, Gender gender) :
_name(name),
_gender(gender)
{
}
void CCharacterData::SetGender(Gender gender)
{
_gender = gender;
}
bool CCharacterData::operator<(const CCharacterData& compare) const
{
return this->_name < compare._name;
}
bool CCharacterData::operator==(const CCharacterData& compare)
{
return (this->_name == compare._name &&
this->_gender == compare._gender);
}
bool CCharacterData::operator!=(const CCharacterData& compare)
{
return (this->_name != compare._name ||
this->_gender != compare._gender);
}
CCharacterData& CCharacterData::operator=(const CCharacterData& characterData)
{
if (this != &characterData)
{
this->_name = characterData._name;
this->_gender = characterData._gender;
}
return *this;
}