#ifndef SCRIPT_LANGUAGE_H #define SCRIPT_LANGUAGE_H /* script_language.h */ #include "core/containers/pair.h" #include "core/containers/rb_map.h" #include "core/io/multiplayer_api.h" #include "core/object/resource.h" class ScriptLanguage; class Script; typedef void (*ScriptEditRequestFunction)(const String &p_path); class ScriptServer { enum { MAX_LANGUAGES = 16 }; static ScriptLanguage *_languages[MAX_LANGUAGES]; static int _language_count; static bool scripting_enabled; static bool reload_scripts_on_save; static bool languages_finished; struct GlobalScriptClass { StringName language; String path; String base; }; static HashMap global_classes; static HashMap global_class_paths; public: static ScriptEditRequestFunction edit_request_func; static void set_scripting_enabled(bool p_enabled); static bool is_scripting_enabled(); _FORCE_INLINE_ static int get_language_count() { return _language_count; } static ScriptLanguage *get_language(int p_idx); static void register_language(ScriptLanguage *p_language); static void unregister_language(ScriptLanguage *p_language); static void set_reload_scripts_on_save(bool p_enable); static bool is_reload_scripts_on_save_enabled(); static void thread_enter(); static void thread_exit(); static void global_classes_clear(); static void add_global_class(const StringName &p_class, const StringName &p_base, const StringName &p_language, const String &p_path); static void remove_global_class(const StringName &p_class); static bool is_global_class(const StringName &p_class); static StringName get_global_class_language(const StringName &p_class); static String get_global_class_path(const StringName &p_class); static StringName get_global_class_name(const String &p_path); static StringName get_global_class_base(const StringName &p_class); static StringName get_global_class_native_base(const StringName &p_class); static Ref