classe terrarium crée

This commit is contained in:
Victor Le Roch 2020-05-20 09:25:14 +02:00
parent e5593747cf
commit 52a4906e2d
2 changed files with 98 additions and 0 deletions

42
app/include/Terrarium.h Normal file
View file

@ -0,0 +1,42 @@
//
// Created by Victor Le Roch on 20/05/2020.
//
#ifndef BE_TERRARIUM_H
#define BE_TERRARIUM_H
class Terrarium {
private:
int id;
float temperature;
float pression;
float PH;
int radState;
int tapState;
public:
Terrarium(int id);
float getTemperature() const;
void setTemperature(float temperature);
float getPression() const;
void setPression(float pression);
float getPh() const;
void setPh(float ph);
int getRadState() const;
void setRadState(int radState);
int getTapState() const;
void setTapState(int tadState);
};
#endif //BE_TERRARIUM_H

56
app/src/Terrarium.cpp Normal file
View file

@ -0,0 +1,56 @@
//
// Created by Victor Le Roch on 20/05/2020.
//
#include "../include/Terrarium.h"
#include "../../core_simulation.h"
float Terrarium::getTemperature() const {
return temperature;
}
void Terrarium::setTemperature(float temperature) {
Terrarium::temperature = temperature;
}
float Terrarium::getPression() const {
return pression;
}
void Terrarium::setPression(float pression) {
Terrarium::pression = pression;
}
float Terrarium::getPh() const {
return PH;
}
void Terrarium::setPh(float ph) {
PH = ph;
}
int Terrarium::getRadState() const {
return radState;
}
void Terrarium::setRadState(int radState) {
Terrarium::radState = radState;
}
int Terrarium::getTapState() const {
return tapState;
}
void Terrarium::setTapState(int tapState) {
Terrarium::tapState = tapState;
}
Terrarium::Terrarium(int id) {
id = id;
pression = 3000;
temperature = 20;
PH = 7;
radState = LOW;
tapState = LOW;
}