diff options
-rw-r--r-- | extension/src/TestSingleton.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/extension/src/TestSingleton.cpp b/extension/src/TestSingleton.cpp index 0855a30..2da8000 100644 --- a/extension/src/TestSingleton.cpp +++ b/extension/src/TestSingleton.cpp @@ -6,31 +6,26 @@ 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 |