From b3e991afa5c3c362317616aad68e30889cf3ef40 Mon Sep 17 00:00:00 2001 From: max-001 Date: Tue, 5 Nov 2024 13:20:44 +0100 Subject: Changed examples a bit to work with new GameObject class --- src/example/script.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/example/script.cpp') diff --git a/src/example/script.cpp b/src/example/script.cpp index 5df26e8..e4c8319 100644 --- a/src/example/script.cpp +++ b/src/example/script.cpp @@ -37,13 +37,7 @@ class MyScript : public Script { int main() { // Create game object with Transform and BehaviorScript components - auto obj = GameObject(0, "name", "tag", 0); - obj.add_component( - Point{ - .x = 1.2, - .y = 3.4, - }, - 0, 0); + auto obj = GameObject(0, "name", "tag", Point{1.2, 3.4}, 0, 1); obj.add_component().set_script(); // Get ScriptSystem singleton instance (this would normally be done from the -- cgit v1.2.3 From 97515abfb2859e289df9d65d7106f35159749131 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 7 Nov 2024 15:27:21 +0100 Subject: no more singleton systems --- src/crepe/system/ScriptSystem.cpp | 8 -------- src/crepe/system/ScriptSystem.h | 5 ----- src/crepe/system/System.h | 14 +++----------- src/example/script.cpp | 2 +- 4 files changed, 4 insertions(+), 25 deletions(-) (limited to 'src/example/script.cpp') diff --git a/src/crepe/system/ScriptSystem.cpp b/src/crepe/system/ScriptSystem.cpp index f1fae4d..f2673e7 100644 --- a/src/crepe/system/ScriptSystem.cpp +++ b/src/crepe/system/ScriptSystem.cpp @@ -12,14 +12,6 @@ using namespace std; using namespace crepe; -ScriptSystem::ScriptSystem() { dbg_trace(); } -ScriptSystem::~ScriptSystem() { dbg_trace(); } - -ScriptSystem & ScriptSystem::get_instance() { - static ScriptSystem instance; - return instance; -} - void ScriptSystem::update() { using namespace std; dbg_trace(); diff --git a/src/crepe/system/ScriptSystem.h b/src/crepe/system/ScriptSystem.h index 32e793c..4fa6141 100644 --- a/src/crepe/system/ScriptSystem.h +++ b/src/crepe/system/ScriptSystem.h @@ -10,13 +10,8 @@ class Script; class ScriptSystem : public System { public: - static ScriptSystem & get_instance(); void update(); -private: - ScriptSystem(); - ~ScriptSystem(); - private: // TODO: to forward_list std::forward_list