aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-07 15:27:21 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-07 15:27:21 +0100
commit97515abfb2859e289df9d65d7106f35159749131 (patch)
treea5755978b1e4c35d258f7b5c9c1bfec529f85ab3 /src/crepe/system
parentb4834c99c1afced63ee0c266b38925b95782bdf6 (diff)
no more singleton systems
Diffstat (limited to 'src/crepe/system')
-rw-r--r--src/crepe/system/ScriptSystem.cpp8
-rw-r--r--src/crepe/system/ScriptSystem.h5
-rw-r--r--src/crepe/system/System.h14
3 files changed, 3 insertions, 24 deletions
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,14 +10,9 @@ class Script;
class ScriptSystem : public System {
public:
- static ScriptSystem & get_instance();
void update();
private:
- ScriptSystem();
- ~ScriptSystem();
-
-private:
// TODO: to forward_list<reference_wrapper>
std::forward_list<Script *> get_scripts();
};
diff --git a/src/crepe/system/System.h b/src/crepe/system/System.h
index ecbb7f5..3b81bef 100644
--- a/src/crepe/system/System.h
+++ b/src/crepe/system/System.h
@@ -4,19 +4,11 @@ namespace crepe {
class System {
public:
- static System & get_instance();
virtual void update() = 0;
-protected:
- System() {};
- virtual ~System() {};
-
-private:
- // singleton
- System(const System &) = delete;
- System(System &&) = delete;
- System & operator=(const System &) = delete;
- System & operator=(System &&) = delete;
+public:
+ System() = default;
+ virtual ~System() = default;
};
} // namespace crepe