add setters

This commit is contained in:
T'JAMPENS QUENTIN p2406187 2025-06-20 14:34:15 +02:00
parent aa61cc14b9
commit f1d1578554
4 changed files with 54 additions and 0 deletions

View File

@ -50,6 +50,41 @@ QList<Step> Path::getStep() const
return step;
}
void Path::setCity(const QString &newCity)
{
city = newCity;
}
void Path::setDepartement(int newDepartement)
{
departement = newDepartement;
}
void Path::setName(const QString &newName)
{
name = newName;
}
void Path::setDifficulty(unsigned int newDifficulty)
{
difficulty = newDifficulty;
}
void Path::setDuration(float newDuration)
{
duration = newDuration;
}
void Path::setLength(float newLength)
{
length = newLength;
}
void Path::setImage(const QString &newImage)
{
image = newImage;
}
Path::Path(QFile *file){
if (!file->open(QIODevice::ReadOnly)) {
qWarning() << "Could not open file:" << file->errorString();

7
path.h
View File

@ -29,6 +29,13 @@ public:
float getLength() const;
QString getImage() const;
QList<Step> getStep() const;
void setCity(const QString &newCity);
void setDepartement(int newDepartement);
void setName(const QString &newName);
void setDifficulty(unsigned int newDifficulty);
void setDuration(float newDuration);
void setLength(float newLength);
void setImage(const QString &newImage);
};
#endif // PATH_H

View File

@ -27,6 +27,16 @@ int Step::getResponse() const
return response;
}
void Step::setTitle(const QString &newTitle)
{
title = newTitle;
}
void Step::setResponse(int newResponse)
{
response = newResponse;
}
Step::Step() {
latitude = 0.0;
longitude = 0.0;

2
step.h
View File

@ -28,6 +28,8 @@ public:
int getResponse() const;
QList<QString> getPersonnage() const;
QList<QString> getTexte() const;
void setTitle(const QString &newTitle);
void setResponse(int newResponse);
};
#endif // STEP_H