aboutsummaryrefslogtreecommitdiff
path: root/extension/src/Checksum.hpp
blob: 717910e0ec8fb25e25f81650585eb8c538e3b7a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once

#include <godot_cpp/core/class_db.hpp>

namespace OpenVic2 {
   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

      inline godot::String get_checksum_text() {
         return godot::String("1234abcd");
      }
   };
}