Ember
Loading...
Searching...
No Matches
TreeBuilder.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <string>
5
6#include "Core/BehaviorTree.h"
7#include "Core/Node.h"
9
10namespace Ember {
11namespace Network {
12
14 public:
15 struct BuildResult {
16 bool success = false;
17 std::shared_ptr<EmberCore::BehaviorTree> tree;
18 int node_count = 0;
19 std::string error;
20 };
21
22 BuildResult Build(const Protocol::TreeInit *tree_init);
23
24 private:
25 std::unique_ptr<EmberCore::Node> BuildNode(const Protocol::NodeDefinition *def);
26
28 const flatbuffers::Vector<flatbuffers::Offset<Protocol::BlackboardDefinition>> *blackboards);
29
31
32 int m_nodeCount = 0;
33};
34
35} // namespace Network
36} // namespace Ember
Represents a complete behavior tree data structure.
Type
Node types for behavior tree classification.
Definition Node.h:25
void BuildBlackboards(EmberCore::BehaviorTree *tree, const flatbuffers::Vector< flatbuffers::Offset< Protocol::BlackboardDefinition > > *blackboards)
EmberCore::Node::Type ConvertNodeType(Protocol::NodeType fb_type)
BuildResult Build(const Protocol::TreeInit *tree_init)
std::unique_ptr< EmberCore::Node > BuildNode(const Protocol::NodeDefinition *def)
std::shared_ptr< EmberCore::BehaviorTree > tree
Definition TreeBuilder.h:17