You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw/components/esm/attr.cpp

26 lines
647 B
C++

#include "attr.hpp"
#include <components/misc/strings/algorithm.hpp>
#include <stdexcept>
using namespace ESM;
const std::string Attribute::sAttributeNames[Attribute::Length] = {
"Strength",
"Intelligence",
"Willpower",
"Agility",
"Speed",
"Endurance",
"Personality",
"Luck",
};
Attribute::AttributeID Attribute::stringToAttributeId(std::string_view attribute)
{
for (int id = 0; id < Attribute::Length; ++id)
if (Misc::StringUtils::ciEqual(sAttributeNames[id], attribute))
return Attribute::AttributeID(id);
throw std::logic_error("No such attribute: " + std::string(attribute));
}