2022-01-07 16:56:26 +01:00
|
|
|
|
|
|
|
#include "node_tree.h"
|
|
|
|
|
2022-01-07 19:28:16 +01:00
|
|
|
#include "node.h"
|
|
|
|
|
|
|
|
Node *NodeTree::get_root() {
|
|
|
|
return _root_node;
|
|
|
|
}
|
|
|
|
|
|
|
|
void NodeTree::set_root(Node *root) {
|
2022-01-08 14:11:08 +01:00
|
|
|
if (_root_node) {
|
|
|
|
_root_node->set_tree(nullptr);
|
|
|
|
}
|
2022-01-07 19:28:16 +01:00
|
|
|
|
|
|
|
_root_node = root;
|
|
|
|
|
|
|
|
if (_root_node) {
|
|
|
|
_root_node->set_tree(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void NodeTree::send_update(float delta) {
|
2022-01-08 14:11:08 +01:00
|
|
|
// todo
|
2022-01-07 19:28:16 +01:00
|
|
|
}
|
|
|
|
|
2022-01-08 14:11:08 +01:00
|
|
|
NodeTree::NodeTree() :
|
|
|
|
Object() {
|
2022-01-07 16:56:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
NodeTree::~NodeTree() {
|
2022-01-08 14:11:08 +01:00
|
|
|
if (_root_node) {
|
|
|
|
delete _root_node;
|
|
|
|
_root_node == nullptr;
|
|
|
|
}
|
2022-01-07 16:56:26 +01:00
|
|
|
}
|