+/*
+ * Copyright (C) 2009 Sakari Poussa
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 2.
+ */
+
#include "data.h"
////////////////////////////////////////////////////////////////////////
return hcp;
}
+void Hole::setHcp(QString& s) {
+ hcp = s;
+}
+
QString Hole::getPar() {
return par;
}
+void Hole::setPar(QString& s) {
+ par = s;
+}
+
void Hole::dump() {
qDebug() << num << "(" << par << ") : " << shots << "/" << putts ;
}
return node;
}
-int Score::update(QVector<QString> scores)
+int Score::update(QVector<QString> &scores)
{
for (int i = 0; i < scores.size(); i++) {
Hole *hole = holeList.at(i);
void Score::dump()
{
- qDebug() << club << " " << course << " " << date ;
+ qDebug() << club << course << date ;
for (int i=0; i<holeList.size(); i++)
holeList.at(i)->dump();
}
return node;
}
+int Course::update(QVector<QString> &par,
+ QVector<QString> &hcp,
+ QVector<QString> &len)
+{
+ for (int i = 0; i < par.size(); i++) {
+ Hole *hole = holeList.at(i);
+ if (hole->getPar() != par[i])
+ hole->setPar(par[i]);
+ if (hole->getHcp() != hcp[i])
+ hole->setHcp(hcp[i]);
+ }
+ return 0;
+}
+
void Course::addHole(Hole *iHole) {
holeList << iHole;
}