This repository has been archived by the owner on Aug 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CursusPrincipal.h
76 lines (66 loc) · 2.74 KB
/
CursusPrincipal.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
74
75
76
#ifndef CURSUSPRINCIPAL_H
#define CURSUSPRINCIPAL_H
#include "includes.h"
//Classe CursusPrincipal
class CursusPrincipal : public Cursus{
//Attributs privés
unsigned int Credits_Total; //Nombre de crédits total à valider
unsigned int Credits_CS; //Nombre de crédits CS à valider
unsigned int Credits_TM; //Nombre de crédits TM à valider
unsigned int Credits_CSTM; //Nombre de crédits CS + TM à valider
unsigned int Credits_TSH; //Nombre de crédits TSH à valider
unsigned int Credits_SP; //Nombre de crédits SP à valider
bool Branche; //Vaut True si le Cursus est une Branche, vaut false sinon
public :
//Constructeur
CursusPrincipal(QString code, QString titre, QString resp, unsigned int tot, unsigned int cs, unsigned int tm, unsigned int cstm, unsigned int tsh, unsigned int sp, bool br)
:Cursus(code, titre, resp), Credits_Total(tot), Credits_CS(cs), Credits_TM(tm), Credits_CSTM(cstm), Credits_TSH(tsh),
Credits_SP(sp), Branche(br){}
//Accesseurs
unsigned int getCreditsCat(Categorie cat) const {
switch(cat){
case 0 : return Credits_CS;
break;
case 1 : return Credits_TM;
break;
case 2 : return Credits_TSH;
break;
case 3 : return Credits_SP;
break;
default : return 0;
}
}
unsigned int getCreditsTotal() const {return Credits_Total;}
unsigned int getCreditsCS() const {return Credits_CS;}
unsigned int getCreditsTM() const {return Credits_TM;}
unsigned int getCreditsCSTM() const {return Credits_CSTM;}
unsigned int getCreditsTSH() const {return Credits_TSH;}
unsigned int getCreditsSP() const {return Credits_SP;}
bool isPrincipal() const {return true;}
bool isSecondaire() const {return false;}
bool isWhat1() const {return !Branche;}
bool isWhat2() const {return Branche;}
//Mutateurs
void setCreditsTotal(unsigned int c) {Credits_Total=c;}
void setCreditsCS(unsigned int c) {Credits_CS=c;}
void setCreditsTM(unsigned int c) {Credits_TM=c;}
void setCreditsCSTM(unsigned int c) {Credits_CSTM=c;}
void setCreditsTSH(unsigned int c) {Credits_TSH=c;}
void setCreditsSP(unsigned int c) {Credits_SP=c;}
//Edition d'un CursusPrincipal
void editCursusPrincipal(QString titre, QString resp, unsigned int tot, unsigned int cs, unsigned int tm, unsigned int cstm, unsigned int tsh, unsigned int sp, bool br){
editCursus(titre, resp);
Credits_Total=tot;
Credits_CS=cs;
Credits_TM=tm;
Credits_CSTM=cstm;
Credits_TSH=tsh;
Credits_SP=sp;
Branche=br;
}
//Destructeur
~CursusPrincipal(){}
//A supprimer
void afficher() const;
};
#endif // CURSUSPRINCIPAL_H