Merge pull request #60527 from KoBeWi/unique_names_demastered

This commit is contained in:
Rémi Verschelde
2022-05-02 10:48:27 +02:00
committed by GitHub
11 changed files with 171 additions and 1 deletions

View File

@@ -97,6 +97,9 @@ private:
Node *parent;
Node *owner;
Vector<Node *> children; // list of children
HashMap<StringName, Node *> owned_unique_nodes;
bool unique_name_in_owner = false;
int pos;
int depth;
int blocked; // safeguard that throws an error when attempting to modify the tree in a harmful way while being traversed.
@@ -203,6 +206,8 @@ private:
friend class SceneTree;
void _set_tree(SceneTree *p_tree);
void _release_unique_name_in_owner();
void _acquire_unique_name_in_owner();
protected:
void _block() { data.blocked++; }
@@ -326,6 +331,9 @@ public:
Node *get_owner() const;
void get_owned_by(Node *p_by, List<Node *> *p_owned);
void set_unique_name_in_owner(bool p_enabled);
bool is_unique_name_in_owner() const;
void remove_and_skip();
int get_index() const;