From 9432900158e6a31815345fcf0af8d28ae34c6da9 Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Fri, 8 Nov 2024 11:44:21 +0100 Subject: code style --- src/crepe/system/AnimatorSystem.h | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/crepe/system/AnimatorSystem.h (limited to 'src/crepe/system/AnimatorSystem.h') diff --git a/src/crepe/system/AnimatorSystem.h b/src/crepe/system/AnimatorSystem.h new file mode 100644 index 0000000..553b456 --- /dev/null +++ b/src/crepe/system/AnimatorSystem.h @@ -0,0 +1,53 @@ +#pragma once + +#include "System.h" + +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: + /** + * \brief Private constructor for the AnimatorSystem. + * + * The constructor is private to enforce the singleton pattern, ensuring that only + * one instance of this system can exist. + */ + AnimatorSystem(); + + /** + * \brief Private destructor for the AnimatorSystem. + * + * The destructor cleans up any resources used by the AnimatorSystem. It is private + * to maintain the singleton pattern and prevent direct deletion. + */ + ~AnimatorSystem(); +}; + +} // namespace crepe -- cgit v1.2.3 From 9f029bf458d43492093507f9b59a67f4f22c283c Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Fri, 8 Nov 2024 12:00:08 +0100 Subject: todo's animator system --- src/crepe/system/AnimatorSystem.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/crepe/system/AnimatorSystem.h') diff --git a/src/crepe/system/AnimatorSystem.h b/src/crepe/system/AnimatorSystem.h index 553b456..c377ce9 100644 --- a/src/crepe/system/AnimatorSystem.h +++ b/src/crepe/system/AnimatorSystem.h @@ -2,6 +2,11 @@ #include "System.h" + + +//TODO: +// control if flip works with animation system + namespace crepe { /** -- cgit v1.2.3