aboutsummaryrefslogtreecommitdiff
path: root/extension/src
diff options
context:
space:
mode:
author Robert Clarke <clarke.john.robert@gmail.com>2023-02-13 00:55:18 +0100
committer Robert Clarke <clarke.john.robert@gmail.com>2023-02-13 00:55:18 +0100
commitea33d7e2d96bcdbf5135f4ab82333bc8c15cdfba (patch)
treedc6c0131d1a4ae76ba471a1e5ee9a7c4c7521308 /extension/src
parentb9e452345899d0066fdae143ec21609fc1996831 (diff)
Reversion of commit e7ee0dd
Diffstat (limited to 'extension/src')
-rw-r--r--extension/src/TestSingleton.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/extension/src/TestSingleton.cpp b/extension/src/TestSingleton.cpp
index 2da8000..0855a30 100644
--- a/extension/src/TestSingleton.cpp
+++ b/extension/src/TestSingleton.cpp
@@ -6,26 +6,31 @@
using namespace godot;
using namespace OpenVic2;
-TestSingleton* TestSingleton::singleton = nullptr;
+TestSingleton *TestSingleton::singleton = nullptr;
-void TestSingleton::_bind_methods() {
+void TestSingleton::_bind_methods()
+{
ClassDB::bind_method(D_METHOD("hello_singleton"), &TestSingleton::hello_singleton);
}
-TestSingleton *TestSingleton::get_singleton() {
+TestSingleton *TestSingleton::get_singleton()
+{
return singleton;
}
-TestSingleton::TestSingleton() {
+TestSingleton::TestSingleton()
+{
ERR_FAIL_COND(singleton != nullptr);
singleton = this;
}
-TestSingleton::~TestSingleton() {
+TestSingleton::~TestSingleton()
+{
ERR_FAIL_COND(singleton != this);
singleton = nullptr;
}
-void TestSingleton::hello_singleton() {
+void TestSingleton::hello_singleton()
+{
UtilityFunctions::print("Hello GDExtension Singleton!");
} \ No newline at end of file