Modifications

- Changement de nom pour le comparateur
- Mise en commentaire du debug
This commit is contained in:
Mylloon 2022-04-06 20:21:28 +02:00
parent 3053a940cf
commit 5e031167a0
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 4 additions and 4 deletions

View file

@ -22,7 +22,7 @@ struct Evenement {
static void affichage(Univers *, bool = false) noexcept; static void affichage(Univers *, bool = false) noexcept;
private: private:
struct comp { struct comp_organisme {
bool operator()(Organisme * organisme_a, Organisme * organisme_b) const { bool operator()(Organisme * organisme_a, Organisme * organisme_b) const {
int vitesse_a, vitesse_b; int vitesse_a, vitesse_b;

View file

@ -143,15 +143,15 @@ void Evenement::lancerSimulation(Univers * univers) {
while(univers->enVie()) { while(univers->enVie()) {
// On trie les organismes en fonction de leur vitesse // 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<Animal *>(it)) { if(Animal * c = dynamic_cast<Animal *>(it)) {
std::cout << it->lettre(it->ID) << " (" << it->ID << ") : " << c->vitesse << std::endl; std::cout << it->lettre(it->ID) << " (" << it->ID << ") : " << c->vitesse << std::endl;
} else { } else {
std::cout << it->lettre(it->ID) << " (" << it->ID << ");" << std::endl; std::cout << it->lettre(it->ID) << " (" << it->ID << ");" << std::endl;
} }
} } */
break; break;
} }
} }