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

Function CreateCustomStat

OsiInterface/Functions/CustomStatFunctions.cpp:172–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170 }
171
172 bool CreateCustomStat(OsiArgumentDesc & args)
173 {
174 auto statName = args[0].String;
175 auto statDescription = args[1].String;
176 auto & statId = args[2].String;
177
178 auto statDefn = FindCustomStatDefinitionByName(statName);
179 if (statDefn != nullptr) {
180 OsiWarn("Custom stat '" << statName << "' already exists!");
181 statId = statDefn->Id.Str;
182 return true;
183 }
184
185 CreateCustomStatInternal(statName, statDescription);
186
187 statDefn = FindCustomStatDefinitionByName(statName);
188 if (statDefn != nullptr) {
189 statId = statDefn->Id.Str;
190 return true;
191 } else {
192 OsiWarn("Unable to create custom stat '" << statName << "' - not found after create message ?!");
193 return false;
194 }
195 }
196
197 bool GetCustomStat(OsiArgumentDesc & args)
198 {

Callers

nothing calls this directly

Calls 2

CreateCustomStatInternalFunction · 0.85

Tested by

no test coverage detected