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

Method has_class

modules/gdscript/gdscript.cpp:1247–1255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1245}
1246
1247bool GDScript::has_class(const GDScript *p_script) {
1248 String fqn = p_script->fully_qualified_name;
1249 if (fully_qualified_name.is_empty() && fqn.get_slice("::", 0).is_empty()) {
1250 return p_script == this;
1251 } else if (fqn.begins_with(fully_qualified_name)) {
1252 return p_script == find_class(fqn.trim_prefix(fully_qualified_name));
1253 }
1254 return false;
1255}
1256
1257GDScript *GDScript::get_root_script() {
1258 GDScript *result = this;

Calls 4

get_sliceMethod · 0.80
begins_withMethod · 0.80
trim_prefixMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected