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

Method make_template

modules/mono/csharp_script.cpp:372–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372Ref<Script> CSharpLanguage::make_template(const String &p_template, const String &p_class_name, const String &p_base_class_name) const {
373 Ref<CSharpScript> scr;
374 scr.instantiate();
375
376 String class_name_no_spaces = p_class_name.replace_char(' ', '_');
377 String base_class_name = get_base_class_name(p_base_class_name, class_name_no_spaces);
378 String processed_template = p_template;
379 processed_template = processed_template.replace("_BINDINGS_NAMESPACE_", BINDINGS_NAMESPACE)
380 .replace("_BASE_", base_class_name)
381 .replace("_CLASS_", class_name_no_spaces)
382 .replace("_TS_", _get_indentation());
383 scr->set_source_code(processed_template);
384 return scr;
385}
386
387Vector<ScriptLanguage::ScriptTemplate> CSharpLanguage::get_built_in_templates(const StringName &p_object) {
388 Vector<ScriptLanguage::ScriptTemplate> templates;

Callers 2

_create_newMethod · 0.45

Calls 5

get_base_class_nameFunction · 0.85
replace_charMethod · 0.80
instantiateMethod · 0.45
replaceMethod · 0.45
set_source_codeMethod · 0.45

Tested by

no test coverage detected