| 40 | } |
| 41 | |
| 42 | bool StatGetAttributeInt(OsiArgumentDesc & args) |
| 43 | { |
| 44 | auto statName = args[0].String; |
| 45 | auto attributeName = args[1].String; |
| 46 | |
| 47 | auto stats = gOsirisProxy->GetLibraryManager().GetStats(); |
| 48 | if (stats == nullptr) { |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | auto object = stats->objects.Find(statName); |
| 53 | if (object == nullptr) { |
| 54 | OsiError("Stat object '" << statName << "' does not exist"); |
| 55 | return false; |
| 56 | } |
| 57 | |
| 58 | auto value = stats->GetAttributeInt(object, attributeName); |
| 59 | if (!value) { |
| 60 | OsiError("Attribute '" << attributeName << "' not found on object '" << statName << "'"); |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | args[2].Int32 = *value; |
| 65 | return true; |
| 66 | } |
| 67 | |
| 68 | bool StatGetAttributeString(OsiArgumentDesc & args) |
| 69 | { |
nothing calls this directly
no test coverage detected