| 123 | } |
| 124 | |
| 125 | std::optional<int> CRPGStatsManager::GetAttributeInt(CRPGStats_Object * object, const char * attributeName) |
| 126 | { |
| 127 | int attributeIndex; |
| 128 | auto typeInfo = GetAttributeInfo(object, attributeName, attributeIndex); |
| 129 | if (typeInfo == nullptr) { |
| 130 | return {}; |
| 131 | } |
| 132 | |
| 133 | auto index = object->IndexedProperties[attributeIndex]; |
| 134 | if (strcmp(typeInfo->Name.Str, "ConstantInt") == 0 |
| 135 | || typeInfo->Values.ItemCount > 0) { |
| 136 | return index; |
| 137 | } |
| 138 | else { |
| 139 | return {}; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | bool CRPGStatsManager::SetAttributeString(CRPGStats_Object * object, const char * attributeName, const char * value) |
| 144 | { |
no outgoing calls
no test coverage detected