@ -1,9 +1,12 @@
# include <iostream>
# include <iostream>
# include <thread>
# include "Personne.hpp"
# include "Personne.hpp"
# include "Contact.hpp"
# include "Contact.hpp"
using namespace std ;
using namespace std ;
using namespace reseau ;
using namespace reseau ;
using this_thread : : sleep_for ;
int main ( ) {
int main ( ) {
Personne p1 { " Bob " } ;
Personne p1 { " Bob " } ;
@ -21,7 +24,7 @@ int main(){
Personne p13 { " Morgane " } ;
Personne p13 { " Morgane " } ;
Personne p14 { " Thibault " } ;
Personne p14 { " Thibault " } ;
Personne p15 { " Gwen " } ;
Personne p15 { " Gwen " } ;
cout < < " ---------- \n " ;
// cout << "----------\n";
Contact c1 { p1 } ;
Contact c1 { p1 } ;
Contact c2 { p2 } ;
Contact c2 { p2 } ;
Contact c3 { p3 } ;
Contact c3 { p3 } ;
@ -37,7 +40,7 @@ int main(){
Contact c13 { p13 } ;
Contact c13 { p13 } ;
Contact c14 { p14 } ;
Contact c14 { p14 } ;
Contact c15 { p15 } ;
Contact c15 { p15 } ;
cout < < " ---------- \n " ;
// cout << "----------\n";
c1 . ajouterContact ( p2 ) ;
c1 . ajouterContact ( p2 ) ;
c1 . ajouterContact ( p5 ) ;
c1 . ajouterContact ( p5 ) ;
c1 . ajouterContact ( p4 ) ;
c1 . ajouterContact ( p4 ) ;
@ -63,50 +66,181 @@ int main(){
// c1.rechercher(p3);
// c1.rechercher(p3);
// c1.rechercher(p2);
// c1.rechercher(p2);
// c1.rechercher(p5);
// c1.rechercher(p5);
cout < < " ---------- \n " ;
// cout << "----------\n";
// menu {
// 1 = technique 1
// LiaisonDirect()
// LiaisonIndirect()
// LiaisonDirect pour une personne()
// LiaisonIndirect pour une personne()
// 2 = technique 2
// LiaisonDirect()
// LiaisonIndirect()
// LiaisonDirect pour une personne()
// LiaisonIndirect pour une personne()
// }
int choix , choix2 , choix3 , persChoix ;
cout < < " \n --------------------------------------------------------------- \n | Technique n°3 (1) | Technique n°2 (2) | Sortir (3) | \n --------------------------------------------------------------- \n \n --> " ;
cin > > choix ;
switch ( choix ) {
case 1 :
case 2 :
cout < < " \n ------------------------------------------------------------- \n | Cas global (1) | Cas individuel (2) | Retour (3) | \n ------------------------------------------------------------- \n \n --> " ;
cin > > choix2 ;
switch ( choix2 ) {
case 1 :
case 2 :
cout < < " \n ------------------------------------------------------------------- \n | Contact Direct (1) | Contact Indirect (2) | Retour (3) | \n ------------------------------------------------------------------- \n \n --> " ;
cin > > choix3 ;
switch ( choix3 ) {
case 1 :
case 2 :
if ( choix2 = = 2 ) {
cout < < " \n Choisissez la personne que vous voulez regarder : \n \n -------------------- \n (1) \t Bob \n (2) \t Domi \n (3) \t Anne \n (4) \t Elie \n (5) \t Cali \n (6) \t Samuel \n (7) \t Elena \n (8) \t Baptiste \n (9) \t Franck \n (10) \t Agathe \n (11) \t Louna \n (12) \t Theo \n (13) \t Morgane \n (14) \t Thibault \n (15) \t Gwen \n -------------------- \n \n Tapez le numéro de la personne : " ;
cin > > persChoix ;
cout < < " \n " ;
switch ( choix3 ) {
case 1 :
if ( persChoix = = 1 )
c1 . afficherContactDirect ( ) ;
c1 . afficherContactDirect ( ) ;
if ( persChoix = = 2 )
c2 . afficherContactDirect ( ) ;
c2 . afficherContactDirect ( ) ;
if ( persChoix = = 3 )
c3 . afficherContactDirect ( ) ;
c3 . afficherContactDirect ( ) ;
if ( persChoix = = 4 )
c4 . afficherContactDirect ( ) ;
c4 . afficherContactDirect ( ) ;
if ( persChoix = = 5 )
c5 . afficherContactDirect ( ) ;
c5 . afficherContactDirect ( ) ;
if ( persChoix = = 6 )
c6 . afficherContactDirect ( ) ;
c6 . afficherContactDirect ( ) ;
if ( persChoix = = 7 )
c7 . afficherContactDirect ( ) ;
c7 . afficherContactDirect ( ) ;
if ( persChoix = = 8 )
c8 . afficherContactDirect ( ) ;
c8 . afficherContactDirect ( ) ;
if ( persChoix = = 9 )
c9 . afficherContactDirect ( ) ;
c9 . afficherContactDirect ( ) ;
if ( persChoix = = 10 )
c10 . afficherContactDirect ( ) ;
c10 . afficherContactDirect ( ) ;
if ( persChoix = = 11 )
c11 . afficherContactDirect ( ) ;
c11 . afficherContactDirect ( ) ;
if ( persChoix = = 12 )
c12 . afficherContactDirect ( ) ;
c12 . afficherContactDirect ( ) ;
if ( persChoix = = 13 )
c13 . afficherContactDirect ( ) ;
c13 . afficherContactDirect ( ) ;
if ( persChoix = = 14 )
c14 . afficherContactDirect ( ) ;
c14 . afficherContactDirect ( ) ;
if ( persChoix = = 15 )
c15 . afficherContactDirect ( ) ;
c15 . afficherContactDirect ( ) ;
cout < < " ---------- \n " ;
break ;
case 2 :
if ( persChoix = = 1 )
c1 . afficherContactIndirect ( ) ;
c1 . afficherContactIndirect ( ) ;
if ( persChoix = = 2 )
c2 . afficherContactIndirect ( ) ;
c2 . afficherContactIndirect ( ) ;
if ( persChoix = = 3 )
c3 . afficherContactIndirect ( ) ;
c3 . afficherContactIndirect ( ) ;
if ( persChoix = = 4 )
c4 . afficherContactIndirect ( ) ;
c4 . afficherContactIndirect ( ) ;
if ( persChoix = = 5 )
c5 . afficherContactIndirect ( ) ;
c5 . afficherContactIndirect ( ) ;
if ( persChoix = = 6 )
c6 . afficherContactIndirect ( ) ;
c6 . afficherContactIndirect ( ) ;
if ( persChoix = = 7 )
c7 . afficherContactIndirect ( ) ;
c7 . afficherContactIndirect ( ) ;
if ( persChoix = = 8 )
c8 . afficherContactIndirect ( ) ;
c8 . afficherContactIndirect ( ) ;
if ( persChoix = = 9 )
c9 . afficherContactIndirect ( ) ;
c9 . afficherContactIndirect ( ) ;
if ( persChoix = = 10 )
c10 . afficherContactIndirect ( ) ;
c10 . afficherContactIndirect ( ) ;
if ( persChoix = = 11 )
c11 . afficherContactIndirect ( ) ;
c11 . afficherContactIndirect ( ) ;
if ( persChoix = = 12 )
c12 . afficherContactIndirect ( ) ;
c12 . afficherContactIndirect ( ) ;
if ( persChoix = = 13 )
c13 . afficherContactIndirect ( ) ;
c13 . afficherContactIndirect ( ) ;
if ( persChoix = = 14 )
c14 . afficherContactIndirect ( ) ;
c14 . afficherContactIndirect ( ) ;
if ( persChoix = = 15 )
c15 . afficherContactIndirect ( ) ;
c15 . afficherContactIndirect ( ) ;
break ;
}
}
else {
switch ( choix3 ) {
case 1 :
c1 . afficherContactDirect ( ) ;
c2 . afficherContactDirect ( ) ;
c3 . afficherContactDirect ( ) ;
c4 . afficherContactDirect ( ) ;
c5 . afficherContactDirect ( ) ;
c6 . afficherContactDirect ( ) ;
c7 . afficherContactDirect ( ) ;
c8 . afficherContactDirect ( ) ;
c9 . afficherContactDirect ( ) ;
c10 . afficherContactDirect ( ) ;
c11 . afficherContactDirect ( ) ;
c12 . afficherContactDirect ( ) ;
c13 . afficherContactDirect ( ) ;
c14 . afficherContactDirect ( ) ;
c15 . afficherContactDirect ( ) ;
break ;
case 2 :
c1 . afficherContactIndirect ( ) ;
c2 . afficherContactIndirect ( ) ;
c3 . afficherContactIndirect ( ) ;
c4 . afficherContactIndirect ( ) ;
c5 . afficherContactIndirect ( ) ;
c6 . afficherContactIndirect ( ) ;
c7 . afficherContactIndirect ( ) ;
c8 . afficherContactIndirect ( ) ;
c9 . afficherContactIndirect ( ) ;
c10 . afficherContactIndirect ( ) ;
c11 . afficherContactIndirect ( ) ;
c12 . afficherContactIndirect ( ) ;
c13 . afficherContactIndirect ( ) ;
c14 . afficherContactIndirect ( ) ;
c15 . afficherContactIndirect ( ) ;
break ;
}
}
break ;
case 3 :
main ( ) ;
break ;
}
break ;
case 3 :
main ( ) ;
break ;
}
sleep_for ( 2 s ) ;
system ( " clear " ) ;
main ( ) ;
break ;
case 3 :
return 0 ;
break ;
}
}
}
// menu {
// 1 = technique 1
// LiaisonDirect()
// LiaisonIndirect()
// LiaisonDirect pour une personne()
// LiaisonIndirect pour une personne()
// 2 = technique 2
// LiaisonDirect()
// LiaisonIndirect()
// LiaisonDirect pour une personne()
// LiaisonIndirect pour une personne()
// }