| 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 | { |
no test coverage detected