beta 1.0 + operator

This commit is contained in:
Cameron Bray 2020-05-27 09:59:21 +02:00
parent e8096b9681
commit 5c3d503b30
3 changed files with 10 additions and 1 deletions

View file

@ -6,6 +6,7 @@
#define BE_TORTUE_H #define BE_TORTUE_H
#include <string> #include <string>
#include <ostream>
class Tortue{ class Tortue{
private: private:
@ -41,6 +42,9 @@ public:
std::string getInfo(); std::string getInfo();
static void delete1(); static void delete1();
friend std::ostream &operator<<(std::ostream &os, const Tortue &tortue);
}; };
#endif //BE_TORTUE_H #endif //BE_TORTUE_H

View file

@ -138,5 +138,10 @@ void Tortue::delete1() {
--nbTortue; --nbTortue;
} }
ostream &operator<<(ostream &os, const Tortue &tortue) {
os << "nom: " << tortue.nom << " naissance: " << tortue.naissance << " sexe: " << tortue.sexe;
return os;
}
Tortue::ExceptionDate::ExceptionDate(int id) : id(id) {} Tortue::ExceptionDate::ExceptionDate(int id) : id(id) {}

View file

@ -61,7 +61,7 @@ void Board::loop() {
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
TemperatureManagement(); TemperatureManagement();
PressureManagement(); PressureManagement();
cout << tortues->back() << endl;
if (menu->getId() == 0 && menu->displayDefault(temperature->getValue(), if (menu->getId() == 0 && menu->displayDefault(temperature->getValue(),
pressure->getValue(), pressure->getValue(),