aboutsummaryrefslogtreecommitdiff
path: root/extension/src/Checksum.hpp
blob: ebdbd4344beccfe04ac561ecf502410c992a3ae0 (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
35
36
37
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;
}