17 lines
570 B
C++
17 lines
570 B
C++
#include "SpeciesVariant.hpp"
|
|
#include <algorithm>
|
|
|
|
const CreatureLib::Library::TalentIndex
|
|
CreatureLib::Library::SpeciesVariant::GetTalentIndex(const ArbUt::StringView& talent) const {
|
|
for (size_t i = 0; i < _talents.Count(); i++) {
|
|
if (_talents.At(i) == talent) {
|
|
return TalentIndex(false, i);
|
|
}
|
|
}
|
|
for (size_t i = 0; i < _secretTalents.Count(); i++) {
|
|
if (_secretTalents.At(i) == talent) {
|
|
return TalentIndex(true, i);
|
|
}
|
|
}
|
|
THROW("The given talent is not a valid talent for this creature.");
|
|
} |