2010-09-24 15:28:14 +02:00
|
|
|
#include "attr.hpp"
|
2023-05-20 17:49:32 +02:00
|
|
|
#include <components/misc/strings/algorithm.hpp>
|
2010-09-24 15:28:14 +02:00
|
|
|
|
|
|
|
using namespace ESM;
|
|
|
|
|
2012-09-17 11:37:50 +04:00
|
|
|
const Attribute::AttributeID Attribute::sAttributeIds[Attribute::Length] = {
|
2010-09-24 15:28:14 +02:00
|
|
|
Attribute::Strength,
|
|
|
|
Attribute::Intelligence,
|
|
|
|
Attribute::Willpower,
|
|
|
|
Attribute::Agility,
|
|
|
|
Attribute::Speed,
|
|
|
|
Attribute::Endurance,
|
|
|
|
Attribute::Personality,
|
2022-09-12 18:35:54 +02:00
|
|
|
Attribute::Luck,
|
2010-09-24 15:28:14 +02:00
|
|
|
};
|
|
|
|
|
2013-08-09 05:14:58 -07:00
|
|
|
const std::string Attribute::sAttributeNames[Attribute::Length] = {
|
|
|
|
"Strength",
|
|
|
|
"Intelligence",
|
|
|
|
"Willpower",
|
|
|
|
"Agility",
|
|
|
|
"Speed",
|
|
|
|
"Endurance",
|
|
|
|
"Personality",
|
2022-09-12 18:35:54 +02:00
|
|
|
"Luck",
|
2013-08-09 05:14:58 -07:00
|
|
|
};
|
|
|
|
|
2012-09-17 11:37:50 +04:00
|
|
|
const std::string Attribute::sGmstAttributeIds[Attribute::Length] = {
|
2010-09-24 15:28:14 +02:00
|
|
|
"sAttributeStrength",
|
|
|
|
"sAttributeIntelligence",
|
|
|
|
"sAttributeWillpower",
|
|
|
|
"sAttributeAgility",
|
|
|
|
"sAttributeSpeed",
|
|
|
|
"sAttributeEndurance",
|
|
|
|
"sAttributePersonality",
|
2022-09-12 18:35:54 +02:00
|
|
|
"sAttributeLuck",
|
2010-09-24 15:28:14 +02:00
|
|
|
};
|
|
|
|
|
2012-09-17 11:37:50 +04:00
|
|
|
const std::string Attribute::sGmstAttributeDescIds[Attribute::Length] = {
|
2010-09-24 15:28:14 +02:00
|
|
|
"sStrDesc",
|
|
|
|
"sIntDesc",
|
|
|
|
"sWilDesc",
|
|
|
|
"sAgiDesc",
|
|
|
|
"sSpdDesc",
|
|
|
|
"sEndDesc",
|
|
|
|
"sPerDesc",
|
2022-09-12 18:35:54 +02:00
|
|
|
"sLucDesc",
|
2010-09-24 15:28:14 +02:00
|
|
|
};
|
2012-05-27 06:39:10 +02:00
|
|
|
|
2012-09-17 11:37:50 +04:00
|
|
|
const std::string Attribute::sAttributeIcons[Attribute::Length] = {
|
2012-05-27 06:39:10 +02:00
|
|
|
"icons\\k\\attribute_strength.dds",
|
|
|
|
"icons\\k\\attribute_int.dds",
|
|
|
|
"icons\\k\\attribute_wilpower.dds",
|
|
|
|
"icons\\k\\attribute_agility.dds",
|
|
|
|
"icons\\k\\attribute_speed.dds",
|
|
|
|
"icons\\k\\attribute_endurance.dds",
|
|
|
|
"icons\\k\\attribute_personality.dds",
|
2022-09-12 18:35:54 +02:00
|
|
|
"icons\\k\\attribute_luck.dds",
|
2012-05-27 06:39:10 +02:00
|
|
|
};
|
2023-05-20 17:49:32 +02:00
|
|
|
|
|
|
|
Attribute::AttributeID Attribute::stringToAttributeId(std::string_view attribute)
|
|
|
|
{
|
|
|
|
for (auto id : ESM::Attribute::sAttributeIds)
|
|
|
|
if (Misc::StringUtils::ciEqual(ESM::Attribute::sAttributeNames[id], attribute))
|
|
|
|
return id;
|
|
|
|
|
|
|
|
throw std::logic_error("No such attribute: " + std::string(attribute));
|
|
|
|
}
|