| 421 | } |
| 422 | |
| 423 | void Unit::setDecisionTreeName(String name) { |
| 424 | _decisionTreeName = name.toString(); |
| 425 | const auto& item = SharedData.getStore()->get(_decisionTreeName); |
| 426 | if (item) { |
| 427 | Decision::Leaf* leaf = item->as<Decision::Leaf>(); |
| 428 | WarnIf(leaf == nullptr, "decision tree \"{}\" not found", _decisionTreeName); |
| 429 | _behaviorTree = nullptr; |
| 430 | _decisionTree = leaf; |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | const std::string& Unit::getDecisionTreeName() const noexcept { |
| 435 | return _decisionTreeName; |
no test coverage detected