aboutsummaryrefslogtreecommitdiff
path: root/extension/src/Checksum.hpp
diff options
context:
space:
mode:
author BrickPi <49528459+BrickPi@users.noreply.github.com>2023-02-27 13:09:41 +0100
committer GitHub <noreply@github.com>2023-02-27 13:09:41 +0100
commite637c3afe2854488d1c2e755e0272f431105c404 (patch)
tree14d5cd52e699d5ebe8602dc3243b71689eec19c5 /extension/src/Checksum.hpp
parent93c6b207c11fdaba484410eb53fc11b35fbbb3bd (diff)
Add Main Menu Version and Checksum Labels (#44)
Diffstat (limited to 'extension/src/Checksum.hpp')
-rw-r--r--extension/src/Checksum.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/extension/src/Checksum.hpp b/extension/src/Checksum.hpp
new file mode 100644
index 0000000..ebdbd43
--- /dev/null
+++ b/extension/src/Checksum.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <godot_cpp/classes/object.hpp>
+#include <godot_cpp/core/class_db.hpp>
+#include <godot_cpp/variant/utility_functions.hpp>
+
+namespace OpenVic2 {
+ class Checksum : public godot::Object {
+ GDCLASS(Checksum, godot::Object)
+
+ //BEGIN BOILERPLATE
+ static Checksum* _checksum;
+
+ 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
+
+ inline godot::String get_checksum_text() {
+ return godot::String("1234abcd");
+ }
+ };
+
+ Checksum* Checksum::_checksum = nullptr;
+} \ No newline at end of file