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

Method _new

modules/gdscript/gdscript.cpp:99–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99Variant GDScriptNativeClass::_new() {
100 Object *o = instantiate();
101 ERR_FAIL_NULL_V_MSG(o, Variant(), "Class type: '" + String(name) + "' is not instantiable.");
102
103 RefCounted *rc = Object::cast_to<RefCounted>(o);
104 if (rc) {
105 return Ref<RefCounted>(rc);
106 } else {
107 return o;
108 }
109}
110
111Object *GDScriptNativeClass::instantiate() {
112 return ClassDB::instantiate_no_placeholders(name);

Callers 1

dict_to_instMethod · 0.45

Calls 7

memdeleteFunction · 0.85
VariantClass · 0.50
StringClass · 0.50
is_nullMethod · 0.45
ptrMethod · 0.45
instantiateMethod · 0.45
is_validMethod · 0.45

Tested by

no test coverage detected