Add getters
This commit is contained in:
@@ -10,6 +10,46 @@
|
||||
|
||||
|
||||
|
||||
QString Path::getCity() const
|
||||
{
|
||||
return city;
|
||||
}
|
||||
|
||||
int Path::getDepartement() const
|
||||
{
|
||||
return departement;
|
||||
}
|
||||
|
||||
QString Path::getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
unsigned int Path::getDifficulty() const
|
||||
{
|
||||
return difficulty;
|
||||
}
|
||||
|
||||
float Path::getDuration() const
|
||||
{
|
||||
return duration;
|
||||
}
|
||||
|
||||
float Path::getLength() const
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
QString Path::getImage() const
|
||||
{
|
||||
return image;
|
||||
}
|
||||
|
||||
QList<Step> Path::getStep() const
|
||||
{
|
||||
return step;
|
||||
}
|
||||
|
||||
Path::Path(QFile *file){
|
||||
if (!file->open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "Could not open file:" << file->errorString();
|
||||
@@ -35,7 +75,7 @@ Path::Path(QFile *file){
|
||||
QJsonArray stepsArray = json["steps"].toArray();
|
||||
for (const QJsonValue &stepValue : stepsArray) {
|
||||
QJsonObject stepObj = stepValue.toObject();
|
||||
step.append(Step(stepObj));
|
||||
//step.append(Step(stepObj));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user