mirror of
https://github.com/godotengine/godot-git-plugin.git
synced 2026-01-02 05:48:34 +03:00
5 lines
1.0 KiB
Plaintext
5 lines
1.0 KiB
Plaintext
// Hint files help the Visual Studio IDE interpret Visual C++ identifiers
|
|
// such as names of functions and macros.
|
|
// For more information see https://go.microsoft.com/fwlink/?linkid=865984
|
|
#define GODOT_CLASS(Name, Base) public: inline static const char *___get_type_name() { return static_cast<const char *>(#Name); } enum { ___CLASS_IS_SCRIPT = 1, }; inline static Name *_new() { godot::NativeScript *script = godot::NativeScript::_new(); script->set_library(godot::get_wrapper<godot::GDNativeLibrary>((godot_object *)godot::gdnlib)); script->set_class_name(#Name); Name *instance = godot::as<Name>(script->new_()); return instance; } inline static size_t ___get_id() { return typeid(Name).hash_code(); } inline static size_t ___get_base_id() { return typeid(Base).hash_code(); } inline static const char *___get_base_type_name() { return Base::___get_class_name(); } inline static Object *___get_from_variant(godot::Variant a) { return (godot::Object *)godot::as<Name>(godot::Object::___get_from_variant(a)); } private:
|