int JGTVS::getValue(Lotter inLotter) const { int end = 0; QList<int> lotters = inLotter.redBall; for (size_t i = 0; i < lotters.size(); i++) { for (size_t j = i + 1; j < lotters.size(); j++) { if (getTailNumber(lotters.at(i)) == getTailNumber(lotters.at(j))) { end++; } } } return end; }
int JGHVH::getValue(Lotter inLotter) const { int sum = 0; for (auto& obj1 : inLotter.redBall) { sum += getTailNumber(obj1); } return sum; }
int JGHVHV::getValue(Lotter inLotter) const { JGHVH jghvh; jghvh.lotter_list = this->lotter_list; if (jghvh.getValue(inLotter) > 10) { return getTailNumber(jghvh.getValue(inLotter)); } return jghvh.getValue(inLotter); }
int JGHVHV::getValue(int lotter_index) const { JGHVH jghvh; jghvh.lotter_list = this->lotter_list; if (jghvh.getValue(lotter_index) > 10) { return getTailNumber(jghvh.getValue(lotter_index)); } return jghvh.getValue(lotter_index); }
int HV::getValue(Lotter inLotter) const { int sum = 0; for (auto& obj : inLotter.redBall) { int obj_w = obj; sum += obj_w; } return getTailNumber(sum); }
//=================================== // find the shortest distance from a // given node in the list until its end // used to find the distnace to the new // number on the screen //=================================== Point NumberList::shortestDistanceToNewNumber(Point curPoint)const{ Point p(0, 0), tmpPoint(0, 0); unsigned int distance = 999; NumberListNode *pTemp; for (pTemp = getTailNumber(); pTemp != NULL; pTemp = pTemp->next){ tmpPoint = pTemp->data.getNumberPosition(); if (curPoint.pointDistance(tmpPoint) < distance){ distance = curPoint.pointDistance(tmpPoint); p = tmpPoint; } } return p; }
int BLUEV::getValue(Lotter inLotter) const { return getTailNumber(inLotter.greenBall); }