From 5e031167a0ed1e0efbec61851ce78361006833a0 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 6 Apr 2022 20:21:28 +0200 Subject: [PATCH] Modifications - Changement de nom pour le comparateur - Mise en commentaire du debug --- includes/evenement.hpp | 2 +- src/evenement.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/evenement.hpp b/includes/evenement.hpp index 4914b9c..8d3c0d4 100644 --- a/includes/evenement.hpp +++ b/includes/evenement.hpp @@ -22,7 +22,7 @@ struct Evenement { static void affichage(Univers *, bool = false) noexcept; private: - struct comp { + struct comp_organisme { bool operator()(Organisme * organisme_a, Organisme * organisme_b) const { int vitesse_a, vitesse_b; diff --git a/src/evenement.cpp b/src/evenement.cpp index 5cdf579..08d1dc6 100644 --- a/src/evenement.cpp +++ b/src/evenement.cpp @@ -143,15 +143,15 @@ void Evenement::lancerSimulation(Univers * univers) { while(univers->enVie()) { // On trie les organismes en fonction de leur vitesse - std::sort(univers->m_liste_univers[univers->ID].second.begin(), univers->m_liste_univers[univers->ID].second.end(), comp()); + std::sort(univers->m_liste_univers[univers->ID].second.begin(), univers->m_liste_univers[univers->ID].second.end(), comp_organisme()); - for(auto it: univers->m_liste_univers[univers->ID].second) { + /* for(auto it: univers->m_liste_univers[univers->ID].second) { if(Animal * c = dynamic_cast(it)) { std::cout << it->lettre(it->ID) << " (" << it->ID << ") : " << c->vitesse << std::endl; } else { std::cout << it->lettre(it->ID) << " (" << it->ID << ");" << std::endl; } - } + } */ break; } }