aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/AnimatorSystem.h
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2024-11-10 19:19:25 +0100
committerJAROWMR <jarorutjes07@gmail.com>2024-11-10 19:19:25 +0100
commitbb0dba6b2a84a8bcbb1e07a14f015f73408d460c (patch)
tree0d669bc5e88544749964d4639d27575545fbabe1 /src/crepe/system/AnimatorSystem.h
parent46716724df7697fa789329a62f7a5444ceed5585 (diff)
parent3a690f7d0c91b92b9cdfe62f44dba8db90142abc (diff)
Merge branch 'master' of github.com:lonkaars/crepe into jaro/particle-system-master
Diffstat (limited to 'src/crepe/system/AnimatorSystem.h')
-rw-r--r--src/crepe/system/AnimatorSystem.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/crepe/system/AnimatorSystem.h b/src/crepe/system/AnimatorSystem.h
new file mode 100644
index 0000000..969e9d1
--- /dev/null
+++ b/src/crepe/system/AnimatorSystem.h
@@ -0,0 +1,44 @@
+#pragma once
+
+#include "System.h"
+
+//TODO:
+// control if flip works with animation system
+
+namespace crepe {
+
+/**
+ * \brief The AnimatorSystem is responsible for managing and updating all Animator components.
+ *
+ * This system is responsible for controlling the behavior of the animations for all entities
+ * that have the Animator component attached. It updates the animations by controlling their
+ * frame changes, looping behavior, and overall animation state.
+ */
+class AnimatorSystem : public System {
+
+public:
+ /**
+ * \brief Retrieves the singleton instance of the AnimatorSystem.
+ *
+ * \return A reference to the single instance of the AnimatorSystem.
+ *
+ * This method ensures that there is only one instance of the AnimatorSystem, following the
+ * singleton design pattern. It can be used to access the system globally.
+ */
+ static AnimatorSystem & get_instance();
+
+ /**
+ * \brief Updates the Animator components.
+ *
+ * This method is called periodically (likely every frame) to update the state of all
+ * Animator components, moving the animations forward and managing their behavior (e.g., looping).
+ */
+ void update() override;
+
+private:
+ // private because singleton
+ AnimatorSystem(); // dbg_trace
+ ~AnimatorSystem(); // dbg_trace
+};
+
+} // namespace crepe