MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _find_node_for_script

Function _find_node_for_script

modules/mono/editor/code_completion.cpp:71–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71Node *_find_node_for_script(Node *p_base, Node *p_current, const Ref<Script> &p_script) {
72 if (p_current->get_owner() != p_base && p_base != p_current) {
73 return nullptr;
74 }
75
76 Ref<Script> c = p_current->get_script();
77
78 if (c == p_script) {
79 return p_current;
80 }
81
82 for (int i = 0; i < p_current->get_child_count(); i++) {
83 Node *found = _find_node_for_script(p_base, p_current->get_child(i), p_script);
84 if (found) {
85 return found;
86 }
87 }
88
89 return nullptr;
90}
91
92void _get_directory_contents(EditorFileSystemDirectory *p_dir, PackedStringArray &r_suggestions) {
93 for (int i = 0; i < p_dir->get_file_count(); i++) {

Callers 1

Calls 4

get_ownerMethod · 0.45
get_scriptMethod · 0.45
get_child_countMethod · 0.45
get_childMethod · 0.45

Tested by

no test coverage detected