Botcraft 1.21.4
Loading...
Searching...
No Matches
BaseNode.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5namespace Botcraft
6{
8 {
9 Tree,
10 Leaf,
13 };
14
16 {
17 public:
18 BaseNode(const std::string& name_);
19 virtual ~BaseNode();
20
21 // Helper functions not directly related to behaviour trees
22 // but useful to work with the tree structure
23 virtual BehaviourNodeType GetNodeType() const = 0;
24 virtual size_t GetNumChildren() const = 0;
25 virtual const BaseNode* GetChild(const size_t index) const = 0;
26
27 std::string GetFullDescriptor() const;
28 const std::string& GetName() const;
29 std::string GetClassName() const;
30 protected:
31 const std::string name;
32 };
33}
virtual const BaseNode * GetChild(const size_t index) const =0
const std::string & GetName() const
Definition BaseNode.cpp:24
virtual size_t GetNumChildren() const =0
std::string GetFullDescriptor() const
Definition BaseNode.cpp:19
std::string GetClassName() const
Definition BaseNode.cpp:29
virtual ~BaseNode()
Definition BaseNode.cpp:14
const std::string name
Definition BaseNode.hpp:31
virtual BehaviourNodeType GetNodeType() const =0
BehaviourNodeType
Definition BaseNode.hpp:8