-
Notifications
You must be signed in to change notification settings - Fork 0
/
Formation.h
73 lines (51 loc) · 1.75 KB
/
Formation.h
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
#ifndef SCHEDULEALGORITHM_FORMATION_H
#define SCHEDULEALGORITHM_FORMATION_H
#include "Interface.h"
using namespace std;
class Formation{
public:
int id; // Missions ID
int day; // Day of the formation
int startHour; // Starting hour of the formation
int endHour; // Ending hour of the formation
int comp; // Required competence
int indexSpec; // Required speciality if possible
vector<float> position; // Place of the formation
Formation(): id(-1), day(-1), startHour(0), endHour(0), comp(-1), indexSpec(-1)
{
position = {-1,-1};
}
Formation(int id, int day, int hDebut, int hFin, int comp, int spec, vector<float> pos):
id(id), day(day), startHour(hDebut), endHour(hFin), comp(comp), indexSpec(spec)
{
position = {pos[0],pos[1]};
}
Formation& operator=(Formation &form)
{
if (this != &form)
{
id = form.id;
day = form.day;
startHour = form.startHour;
endHour = form.endHour;
comp = form.comp;
indexSpec = form.indexSpec;
position = form.position;
}
return *this;
}
friend ostream& operator<<(ostream& out_object, Formation& form)
{
out_object << form.startHour << " - " << form.endHour;
return out_object;
}
void displayFormation() // General information about the formation
{
cout << "Formation ID "<< id;
cout << " - day " << day << endl;
cout << "Slot : " << startHour << " - " << endHour << endl;
cout << "Position is {" << position[0] << ", " << position[1] << "}" << endl;
cout << startHour << " - " << endHour;
}
};
#endif //SCHEDULEALGORITHM_FORMATION_H