Sarafun Behavior Trees package  1
Behavior trees for the SARAFun project
 All Data Structures Namespaces Functions Variables Enumerations Enumerator
YamlCreator.cpp
1 #include <tree_generator/YamlCreator.hpp>
2 
3 namespace tree_generator{
4 
7 
8  void YamlCreator::addField(std::string label, std::string field, int value)
9  {
10  YAML::Node label_node;
11 
12  if (base_node_["sarafun"][label])
13  {
14  label_node = base_node_["sarafun"][label];
15  }
16 
17  label_node[field] = value;
18  base_node_["sarafun"][label] = label_node;
19  }
20 
21  void YamlCreator::writeFile(std::string file_path)
22  {
23  std::ofstream file;
24  file.open(file_path);
25  file << base_node_;
26  file.close();
27  }
28 }
void writeFile(std::string file_path)
Definition: YamlCreator.cpp:21
void addField(std::string label, std::string field, int value)
Definition: YamlCreator.cpp:8