void pkmviewer::updatestats() { if(redisplayok) { ui->sbTotalEVs->setValue ( temppkm->evs.hp + temppkm->evs.attack + temppkm->evs.defense + temppkm->evs.spatk + temppkm->evs.spdef + temppkm->evs.speed ); ui->sbHP->setValue(getpkmstat(temppkm,Stat_IDs::hp)); ui->sbAtk->setValue(getpkmstat(temppkm,Stat_IDs::attack)); ui->sbDef->setValue(getpkmstat(temppkm,Stat_IDs::defense)); ui->sbSpAtk->setValue(getpkmstat(temppkm,Stat_IDs::spatk)); ui->sbSpDef->setValue(getpkmstat(temppkm,Stat_IDs::spdef)); ui->sbSpeed->setValue(getpkmstat(temppkm,Stat_IDs::speed)); std::string thechar = lookupcharacteristic(temppkm); ui->lblCharacteristic->setText(QString::fromStdString(lookupcharacteristic(temppkm))); } }
bool comparebyhpasc(const pokemon_obj &a, const pokemon_obj &b) { return getpkmstat(a,Stat_IDs::hp) < getpkmstat(b,Stat_IDs::hp); }
bool comparebyspdefasc(const pokemon_obj &a, const pokemon_obj &b) { return getpkmstat(a,Stat_IDs::spdef) < getpkmstat(b,Stat_IDs::spdef); }
bool comparebydefenseasc(const pokemon_obj &a, const pokemon_obj &b) { return getpkmstat(a,Stat_IDs::defense) < getpkmstat(b,Stat_IDs::defense); }
bool comparebyattackasc(const pokemon_obj &a, const pokemon_obj &b) { return getpkmstat(a,Stat_IDs::attack) < getpkmstat(b,Stat_IDs::attack); }
//void sortbyspeedascp(std::vector<pokemon_obj>* pkm) //{ // std::sort(pkm->begin(), pkm->end(), comparebyspeedascp); //} bool comparebyspatkascp(const pokemon_obj *a, const pokemon_obj *b) { return getpkmstat(a,Stat_IDs::spatk) < getpkmstat(b,Stat_IDs::spatk); }