MCPcopy Create free account
hub / github.com/Norbyte/ositools / GetAttributeFixedString

Method GetAttributeFixedString

OsiInterface/DivInterface.cpp:99–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 }
98
99 std::optional<FixedString> CRPGStatsManager::GetAttributeFixedString(CRPGStats_Object * object, const char * attributeName)
100 {
101 int attributeIndex;
102 auto typeInfo = GetAttributeInfo(object, attributeName, attributeIndex);
103 if (typeInfo == nullptr) {
104 return {};
105 }
106
107 auto index = object->IndexedProperties[attributeIndex];
108 if (strcmp(typeInfo->Name.Str, "FixedString") == 0) {
109 return ModifierFSSet.Buf[index];
110 }
111 else if (typeInfo->Values.ItemCount > 0) {
112 auto enumLabel = typeInfo->Values.FindByValue(index);
113 if (enumLabel) {
114 return *enumLabel;
115 }
116 else {
117 return {};
118 }
119 }
120 else {
121 return {};
122 }
123 }
124
125 std::optional<int> CRPGStatsManager::GetAttributeInt(CRPGStats_Object * object, const char * attributeName)
126 {

Callers 1

StatGetAttributeStringFunction · 0.80

Calls 1

FindByValueMethod · 0.80

Tested by

no test coverage detected