MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / registerScriptingEnum

Method registerScriptingEnum

src/bt_factory.cpp:491–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491void BehaviorTreeFactory::registerScriptingEnum(StringView name, int value)
492{
493 const auto str = std::string(name);
494 auto it = _p->scripting_enums->find(str);
495 if(it == _p->scripting_enums->end())
496 {
497 _p->scripting_enums->insert({ str, value });
498 }
499 else
500 {
501 if(it->second != value)
502 {
503 throw LogicError(
504 StrCat("Registering the enum [", name, "] twice with different values, first ",
505 std::to_string(it->second), " and later ", std::to_string(value)));
506 }
507 }
508}
509
510void BehaviorTreeFactory::clearSubstitutionRules()
511{

Callers 2

TESTFunction · 0.80
mainFunction · 0.80

Calls 5

stringFunction · 0.85
LogicErrorClass · 0.85
StrCatFunction · 0.85
to_stringFunction · 0.50
endMethod · 0.45

Tested by 1

TESTFunction · 0.64