Extended user interaction, fixed related problems
This commit is contained in:
parent
f742061a5e
commit
9bdce6a96b
5 changed files with 118 additions and 22 deletions
43
iFacility/objects/userprofession.cpp
Normal file
43
iFacility/objects/userprofession.cpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#include "userprofession.h"
|
||||
|
||||
UserProfession::UserProfession(PID pid, ProfRank rank) {
|
||||
mProfession = pid;
|
||||
mRank = rank;
|
||||
}
|
||||
|
||||
PID UserProfession::getProfession() const {
|
||||
return mProfession;
|
||||
}
|
||||
|
||||
QDate UserProfession::getAcquiredDate() const {
|
||||
return mAcquired;
|
||||
}
|
||||
|
||||
ProfRank UserProfession::getRank() const {
|
||||
return mRank;
|
||||
}
|
||||
|
||||
bool UserProfession::setRank(quint8 newRank) {
|
||||
if (newRank < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mRank = newRank;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool operator==(const UserProfession &l, const UserProfession &r) {
|
||||
return l.mProfession == r.mProfession &&
|
||||
l.mAcquired == r.mAcquired &&
|
||||
l.mRank == r.mRank;
|
||||
}
|
||||
|
||||
QDataStream& operator<<(QDataStream &stream, const UserProfession &up) {
|
||||
stream << up.mProfession << up.mAcquired << up.mRank;
|
||||
return stream;
|
||||
}
|
||||
|
||||
QDataStream& operator>>(QDataStream &stream, UserProfession &up) {
|
||||
stream >> up.mProfession >> up.mAcquired >> up.mRank;
|
||||
return stream;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue