classe tortue crée
This commit is contained in:
parent
52a4906e2d
commit
a108668d6d
2 changed files with 50 additions and 0 deletions
25
app/include/Tortue.h
Normal file
25
app/include/Tortue.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// Created by Victor Le Roch on 20/05/2020.
|
||||
//
|
||||
|
||||
#ifndef BE_TORTUE_H
|
||||
#define BE_TORTUE_H
|
||||
|
||||
#include <string>
|
||||
|
||||
class Tortue{
|
||||
private:
|
||||
std::string nom;
|
||||
int naissance;
|
||||
std::string sexe;
|
||||
public:
|
||||
Tortue(const std::string &nom, const std::string &sexe);
|
||||
|
||||
const std::string &getNom() const;
|
||||
|
||||
int getNaissance() const;
|
||||
|
||||
const std::string &getSexe() const;
|
||||
};
|
||||
|
||||
#endif //BE_TORTUE_H
|
25
app/src/Tortue.cpp
Normal file
25
app/src/Tortue.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// Created by Victor Le Roch on 20/05/2020.
|
||||
//
|
||||
|
||||
#include "../include/Tortue.h"
|
||||
#include "../../core_simulation.h"
|
||||
//#include <string>
|
||||
|
||||
const std::string &Tortue::getNom() const {
|
||||
return nom;
|
||||
}
|
||||
|
||||
int Tortue::getNaissance() const {
|
||||
return naissance;
|
||||
}
|
||||
|
||||
const std::string &Tortue::getSexe() const {
|
||||
return sexe;
|
||||
}
|
||||
|
||||
Tortue::Tortue(const string &nom, const string &sexe) : nom(nom), sexe(sexe) {
|
||||
naissance = std::time(nullptr);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue