-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTeam.cpp
85 lines (72 loc) · 1.52 KB
/
Team.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "Team.h"
Team::Team(
unsigned short number,
unsigned short qs,
unsigned short firstSort,
unsigned short secondSort,
unsigned short thirdSort,
unsigned short fourthSort
) {
this->number = number;
this->qs = qs;
this->firstSort = firstSort;
this->secondSort = secondSort;
this->thirdSort = thirdSort;
this->fourthSort = fourthSort;
}
Team::~Team() {};
unsigned short Team::getNumber() const {
return this->number;
}
unsigned short Team::getQS() const {
return this->qs;
}
unsigned short Team::getFirstSort() const {
return this->firstSort;
}
unsigned short Team::getSecondSort() const {
return this->secondSort;
}
unsigned short Team::getThirdSort() const {
return this->thirdSort;
}
unsigned short Team::getFourthSort() const {
return this->fourthSort;
}
void Team::win() {
qs += 2;
}
bool Team::lessThan (const Team &team2) const {
if (qs < team2.qs) {
return true;
} else if (qs > team2.qs) {
return false;
} else {
if (firstSort < team2.firstSort) {
return true;
} else if (firstSort > team2.firstSort) {
return false;
} else {
if (secondSort < team2.secondSort) {
return true;
} else if (secondSort > team2.secondSort) {
return false;
} else {
if (thirdSort < team2.thirdSort) {
return true;
} else if (thirdSort > team2.thirdSort) {
return false;
} else {
if (fourthSort < team2.fourthSort) {
return true;
} else {
return false;
}
}
}
}
}
}
bool Team::operator < (const Team &t2) const {
return !lessThan(t2);
}