| 87 | }; |
| 88 | |
| 89 | class AbsBehaviorTree |
| 90 | { |
| 91 | public: |
| 92 | |
| 93 | typedef std::deque<AbstractTreeNode> NodesVector; |
| 94 | |
| 95 | AbsBehaviorTree() {} |
| 96 | |
| 97 | ~AbsBehaviorTree(); |
| 98 | |
| 99 | size_t nodesCount() const { |
| 100 | return _nodes.size(); |
| 101 | } |
| 102 | |
| 103 | const NodesVector& nodes() const { return _nodes; } |
| 104 | |
| 105 | NodesVector& nodes() { return _nodes; } |
| 106 | |
| 107 | const AbstractTreeNode* node(size_t index) const { return &_nodes.at(index); } |
| 108 | |
| 109 | AbstractTreeNode* node(size_t index) { return &_nodes.at(index); } |
| 110 | |
| 111 | AbstractTreeNode* rootNode(); |
| 112 | |
| 113 | const AbstractTreeNode* rootNode() const; |
| 114 | |
| 115 | std::vector<const AbstractTreeNode*> findNodes(const QString& instance_name); |
| 116 | |
| 117 | const AbstractTreeNode* findFirstNode(const QString& instance_name); |
| 118 | |
| 119 | AbstractTreeNode* addNode(AbstractTreeNode* parent, AbstractTreeNode &&new_node ); |
| 120 | |
| 121 | void debugPrint() const; |
| 122 | |
| 123 | bool operator ==(const AbsBehaviorTree &other) const; |
| 124 | |
| 125 | bool operator !=(const AbsBehaviorTree &other) const{ |
| 126 | return !(*this == other); |
| 127 | } |
| 128 | |
| 129 | void clear(); |
| 130 | |
| 131 | private: |
| 132 | NodesVector _nodes; |
| 133 | }; |
| 134 | |
| 135 | static int GetUID() |
| 136 | { |
no outgoing calls
no test coverage detected