const std::string& SpeciesManager::RandomPlayableSpeciesName() const { if (NumPlayableSpecies() <= 0) return EMPTY_STRING; int species_idx = RandSmallInt(0, NumPlayableSpecies() - 1); return std::next(playable_begin(), species_idx)->first; }
const std::string& SpeciesManager::SequentialPlayableSpeciesName(int id) const { if (NumPlayableSpecies() <= 0) return EMPTY_STRING; int species_idx = id % NumPlayableSpecies(); DebugLogger() << "SpeciesManager::SequentialPlayableSpeciesName has " << NumPlayableSpecies() << " and is given id " << id << " yielding index " << species_idx; return std::next(playable_begin(), species_idx)->first; }
const std::string& SpeciesManager::RandomPlayableSpeciesName() const { if (NumPlayableSpecies() <= 0) return EMPTY_STRING; int species_idx = RandSmallInt(0, NumPlayableSpecies() - 1); playable_iterator it = playable_begin(); std::advance(it, species_idx); return it->first; }
int SpeciesManager::NumPlayableSpecies() const { return std::distance(playable_begin(), playable_end()); }