From 61ab6af0e5cf5b2cd1c9da306929d5d21e77d835 Mon Sep 17 00:00:00 2001 From: jopierron Date: Fri, 1 Apr 2022 08:05:15 +0000 Subject: [PATCH] Delete main.cpp --- src/main.cpp | 212 --------------------------------------------------- 1 file changed, 212 deletions(-) delete mode 100644 src/main.cpp diff --git a/src/main.cpp b/src/main.cpp deleted file mode 100644 index e3fe43b..0000000 --- a/src/main.cpp +++ /dev/null @@ -1,212 +0,0 @@ -#include -#include -#include "Personne.hpp" -#include"Personne2.h" -#include"Contact.hpp" - -using namespace std; -using namespace reseau; - - - -int main() { - - /* - On crée chaque personne qui seront dans notre réseau - */ - - reseau::Personne p1{"Bob"}; - reseau::Personne p2{"Domi"}; - reseau::Personne p3{"Anne"}; - reseau::Personne p4{"Elie"}; - reseau::Personne p5{"Cali"}; - reseau::Personne p6{"Samuel"}; - reseau::Personne p7{"Elena"}; - reseau::Personne p8{"Baptiste"}; - reseau::Personne p9{"Franck"}; - reseau::Personne p10{"Agathe"}; - reseau::Personne p11{"Louna"}; - reseau::Personne p12{"Theo"}; - reseau::Personne p13{"Morgane"}; - reseau::Personne p14{"Thibault"}; - reseau::Personne p15{"Gwen"}; - list Contacts; - /* - On crée les contacts en mettant leur propiétaire, on ajoute ensuite chaque contact dans une liste juste après leur construction - */ - Contact c1{p1}; - Contacts.push_back(&c1); - Contact c2{p2}; - Contacts.push_back(&c2); - Contact c3{p3}; - Contacts.push_back(&c3); - Contact c4{p4}; - Contacts.push_back(&c4); - Contact c5{p5}; - Contacts.push_back(&c5); - Contact c6{p6}; - Contacts.push_back(&c6); - Contact c7{p7}; - Contacts.push_back(&c7); - Contact c8{p8}; - Contacts.push_back(&c8); - Contact c9{p9}; - Contacts.push_back(&c9); - Contact c10{p10}; - Contacts.push_back(&c10); - Contact c11{p11}; - Contacts.push_back(&c11); - Contact c12{p12}; - Contacts.push_back(&c12); - Contact c13{p13}; - Contacts.push_back(&c13); - Contact c14{p14}; - Contacts.push_back(&c14); - Contact c15{p15}; - Contacts.push_back(&c15); - - - /* - On place les contacts directs dans une liste de personne qui correspond au répertoire de chaque personne - */ - c1.ajouterContact(p2); - c1.ajouterContact(p5); - c1.ajouterContact(p4); - c3.ajouterContact(p1); - c3.ajouterContact(p2); - c4.ajouterContact(p5); - c4.ajouterContact(p6); - c5.ajouterContact(p4); - c6.ajouterContact(p7); - c6.ajouterContact(p9); - c7.ajouterContact(p3); - c8.ajouterContact(p2); - c9.ajouterContact(p6); - c9.ajouterContact(p11); - c10.ajouterContact(p7); - c10.ajouterContact(p8); - c11.ajouterContact(p15); - c12.ajouterContact(p10); - c13.ajouterContact(p11); - c14.ajouterContact(p12); - c14.ajouterContact(p13); - c15.ajouterContact(p9); - - vector Repertoire = { c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15 }; - - int i=1; - Repertoire[i].afficherContactDirect(); - - /* - Début du menu et initialisation des variables qu'on utilisera pour chaque partie de celui-ci - */ - int choix, choix2, choix3, persChoix, persDest, persEnvoie; - - - cout <<"\n ---------------------------------------------------------------\n | Technique n°1 (1) | Technique n°3 (2) | Sortir (3) |\n ---------------------------------------------------------------\n\n--> "; - cin >> choix; - switch(choix) { - case 1 : - - cout << "\n -------------------------------------------------------------\n | Cas global (1) | Cas individuel (2) | Retour (3) |\n -------------------------------------------------------------\n\n--> "; - cin >> choix2; - switch(choix2) { - /* - Le cas 1 et le cas 2 feront le même code au début donc on appliquera leurs différences plus tard dans un if - */ - case 1: - case 2: - - cout <<"\n -------------------------------------------------------------------\n | Contact Direct (1) | Contact Indirect (2) | Retour (3) |\n -------------------------------------------------------------------\n\n--> "; - cin >> choix3; - switch(choix3) { - /* - Le cas 1 et le cas 2 feront le même code au début donc on appliquera leurs différences plus tard dans un autre switch - */ - case 1: - case 2: - - /* - On applique en fonction de notre choix2 les méthodes et l'affichage voulu, afin d'éviter des répétitions dans les case. - */ - if(choix2==2){ - - cout << "\n Choisissez la personne que vous voulez regarder : \n\n--------------------\n(1)\tBob\n(2)\tDomi\n(3)\tAnne\n(4)\tElie\n(5)\tCali\n(6)\tSamuel\n(7)\tElena\n(8)\tBaptiste\n(9)\tFranck\n(10)\tAgathe\n(11)\tLouna\n(12)\tTheo\n(13)\tMorgane\n(14)\tThibault\n(15)\tGwen\n--------------------\n\n Tapez le numéro de la personne : "; - cin >> persChoix ; - cout << "\n"; - /* - On applique en fonction de notre choix3 les méthodes voulu, afin d'éviter des répétitions dans les case. - */ - switch(choix3) { - case 1: - /* - En fonction de la personne choisi avec la variable persChoix, il affiche ses contacts directs - */ - Repertoire[persChoix-1].afficherContactDirect(); - break; - case 2: - /* - En fonction de la personne choisi avec la variable persChoix, il affiche sa propagation - */ - Repertoire[persChoix-1].afficherContactIndirect(Contacts); - break; - } - } - else{ - switch(choix3){ - case 1: - /* - On affiche les contacts directs de tout le réseau - */ - for (long unsigned int i=0; i> persEnvoie ; - cout << "\n"; - cout << "\n Choisissez le destinataire : \n\n--------------------\n(1)\tBob\n(2)\tDomi\n(3)\tAnne\n(4)\tElie\n(5)\tCali\n(6)\tSamuel\n(7)\tElena\n(8)\tBaptiste\n(9)\tFranck\n(10)\tAgathe\n(11)\tLouna\n(12)\tTheo\n(13)\tMorgane\n(14)\tThibault\n(15)\tGwen\n--------------------\n\n Tapez le numéro de la personne : "; - cin >> persDest ; - cout << "\n"; - Repertoire[persEnvoie-1].peutCommuniquer(Repertoire[persDest-1]); - main(); - break; - case 3 : - /* le return sert pour arrêter le programme lorsqu'on demande l'exit sur le premier menu*/ - exit(0); /* */ - break; - } - -} -