diff options
author | Hop311 <hop3114@gmail.com> | 2023-09-14 09:52:25 +0200 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-09-14 09:52:25 +0200 |
commit | 70c040d042cb536e5ce16b0cfff0e0afa39e8ed7 (patch) | |
tree | 559681d5a2569adc307409d818311760edc12654 /extension/src/openvic-extension/Checksum.hpp | |
parent | 9dc8c3c89a86b8be2084890f3207adc6c9cda496 (diff) |
Logger::warning, format cleanup + req comments
Diffstat (limited to 'extension/src/openvic-extension/Checksum.hpp')
-rw-r--r-- | extension/src/openvic-extension/Checksum.hpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/extension/src/openvic-extension/Checksum.hpp b/extension/src/openvic-extension/Checksum.hpp new file mode 100644 index 0000000..b12a9cd --- /dev/null +++ b/extension/src/openvic-extension/Checksum.hpp @@ -0,0 +1,37 @@ +#pragma once + +#include <godot_cpp/core/class_db.hpp> + +namespace OpenVic { + class Checksum : public godot::Object { + GDCLASS(Checksum, godot::Object) + + // BEGIN BOILERPLATE + inline static Checksum* _checksum = nullptr; + + protected: + static void _bind_methods() { + godot::ClassDB::bind_method(godot::D_METHOD("get_checksum_text"), &Checksum::get_checksum_text); + } + + public: + inline static Checksum* get_singleton() { return _checksum; } + + inline Checksum() { + ERR_FAIL_COND(_checksum != nullptr); + _checksum = this; + } + inline ~Checksum() { + ERR_FAIL_COND(_checksum != this); + _checksum = nullptr; + } + // END BOILERPLATE + + /* REQUIREMENTS: + * DAT-8 + */ + inline godot::String get_checksum_text() { + return godot::String("1234abcd"); + } + }; +} |