| 489 | } |
| 490 | |
| 491 | void 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 | |
| 510 | void BehaviorTreeFactory::clearSubstitutionRules() |
| 511 | { |