diff options
author | Spartan322 <Megacake1234@gmail.com> | 2023-11-10 05:14:58 +0100 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2023-11-10 23:15:32 +0100 |
commit | cf591eddfa59839c2620ebf119727f069b965dfe (patch) | |
tree | 65ca78284e4ed1a2b07716018a721aaaf68d3830 /extension/src/openvic-extension/Checksum.hpp | |
parent | f8da0860795d273452501fa4d7fbfcc40073a884 (diff) |
Add ClassBinding helpers
OV_BIND_METHOD
OV_BIND_SMETHOD
OV_BIND_SMETHOD_L
Change _bind_methods to use ClassBinding helpers
Add utility/StringLiteral
Make `GameSingleton::singleton` inline
Move `OpenVic::Checksum` implementation to source file
Update scripts to ce1aef8d7d9d5ba9851a1abdd981d3b796024079
Diffstat (limited to 'extension/src/openvic-extension/Checksum.hpp')
-rw-r--r-- | extension/src/openvic-extension/Checksum.hpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/extension/src/openvic-extension/Checksum.hpp b/extension/src/openvic-extension/Checksum.hpp index c5d8daf..2b2f959 100644 --- a/extension/src/openvic-extension/Checksum.hpp +++ b/extension/src/openvic-extension/Checksum.hpp @@ -1,6 +1,8 @@ #pragma once #include <godot_cpp/core/class_db.hpp> +#include <godot_cpp/core/object.hpp> +#include <godot_cpp/variant/string.hpp> namespace OpenVic { class Checksum : public godot::Object { @@ -10,30 +12,15 @@ namespace OpenVic { static inline Checksum* _checksum = nullptr; protected: - static void _bind_methods() { - godot::ClassDB::bind_method(godot::D_METHOD("get_checksum_text"), &Checksum::get_checksum_text); - } + static void _bind_methods(); public: - static inline Checksum* get_singleton() { - return _checksum; - } + static Checksum* get_singleton(); - inline Checksum() { - ERR_FAIL_COND(_checksum != nullptr); - _checksum = this; - } - inline ~Checksum() { - ERR_FAIL_COND(_checksum != this); - _checksum = nullptr; - } + Checksum(); + ~Checksum(); // END BOILERPLATE - /* REQUIREMENTS: - * DAT-8 - */ - inline godot::String get_checksum_text() { - return godot::String("1234abcd"); - } + godot::String get_checksum_text(); }; } |