// ---------------------------------------------------------------------------- void GrandPrixData::getReverse(std::vector<bool> *reverse) const { reverse->clear(); for(unsigned int i=0; i< m_tracks.size(); i++) if(isTrackAvailable(m_tracks[i])) reverse->push_back(m_reversed[i]); } // getReverse
// ---------------------------------------------------------------------------- void GrandPrixData::getLaps(std::vector<int> *laps) const { laps->clear(); for(unsigned int i=0; i< m_tracks.size(); i++) if(isTrackAvailable(m_tracks[i])) laps->push_back(m_laps[i]); } // getLaps
/** Returns the reverse setting for each available grand prix. * \param include_locked If data for locked tracks should be included or not. * \return A copy of alist with the reverse status for each track. */ std::vector<bool> GrandPrixData::getReverse(bool include_locked) const { std::vector<bool> reverse; for (unsigned int i = 0; i< m_tracks.size(); i++) if(isTrackAvailable(m_tracks[i], include_locked)) reverse.push_back(m_reversed[i]); return reverse; } // getReverse
/** Returns the laps for each available track of the grand prix. * \param include_locked If data for locked tracks should be included or not. * \return a std::vector containing the laps for each grand prix. */ std::vector<int> GrandPrixData::getLaps(bool include_locked) const { std::vector<int> laps; for (unsigned int i = 0; i< m_tracks.size(); i++) if(isTrackAvailable(m_tracks[i], include_locked)) laps.push_back(m_laps[i]); return laps; } // getLaps
/** Returns the list of tracks that is available (i.e. unlocked) of this * grand prix. * \param include_locked If data for locked tracks should be included or not. * \return A copy of the list of available tracks in this grand prix. */ std::vector<std::string> GrandPrixData::getTrackNames(bool include_locked) const { std::vector<std::string> names; for (unsigned int i = 0; i < m_tracks.size(); i++) { if(isTrackAvailable(m_tracks[i], include_locked)) names.push_back(m_tracks[i]); } return names; } // getTrackNames
// ---------------------------------------------------------------------------- const std::vector<std::string>& GrandPrixData::getTrackNames() const { m_really_available_tracks.clear(); for(unsigned int i=0; i< m_tracks.size(); i++) { if(isTrackAvailable(m_tracks[i])) m_really_available_tracks.push_back(m_tracks[i]); } // for i return m_really_available_tracks; } // getTrackNames