-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassager.cpp
87 lines (76 loc) · 1.65 KB
/
passager.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
86
87
/*Turikumwe Fabrice E.
Allan Tarcy*/
#include "passager.hpp"
using namespace std;
Passager::Passager(int i, string n, string p) : id(i), nom(n), prenom(p), reduction(1), categorie("normal")
{
}
Passager::Passager(int i, string n, string p, Billet *b) : id(i), nom(n), prenom(p), reduction(1), categorie("normal")
{
billetPassager.push_back(b);
}
Insulaire::Insulaire(int i, string n, string p) : Passager(i, n, p)
{
categorie = "insulaire";
reduction = 0.5;
}
Insulaire::Insulaire(int i, string n, string p, Billet *b) : Passager(i, n, p, b)
{
categorie = "insulaire";
reduction = 0.5;
billetPassager.push_back(b);
}
InsulaireSecondaire::InsulaireSecondaire(int i, string n, string p) : Passager(i, n, p)
{
categorie = "insulaire secondaire";
reduction = 0.25;
}
InsulaireSecondaire::InsulaireSecondaire(int i, string n, string p, Billet *b) : Passager(i, n, p, b)
{
categorie = "insulaire secondaire";
reduction = 0.25;
billetPassager.push_back(b);
}
Passager::~Passager(){
billetPassager.clear();
}
int Passager::getId()
{
return id;
}
string Passager::getNom() const
{
return nom;
}
string Passager::getPrenom() const
{
return prenom;
}
void Passager::getBillets()
{
vector<Billet *>::iterator it;
for (it = billetPassager.begin(); it != billetPassager.end(); it++)
{
(*it)->Affiche();
}
}
void Passager::setNom(string n)
{
nom = n;
}
void Passager::setPrenom(string p)
{
prenom = p;
}
void Passager::ajoutBillet(Billet *b)
{
billetPassager.push_back(b);
}
double Passager::getReduction()
{
return reduction;
}
string Passager::getCategorie() const
{
return categorie;
}