![]() |
galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
|
Allows for an entity to be animated. More...
#include <Animated.hpp>
Public Member Functions | |
Animated () | |
Constructor. | |
Animated (const nlohmann::json &json) | |
JSON constructor. | |
Animated (Animated &&) | |
Move constructor. | |
Animated & | operator= (Animated &&) |
Move assignment operator. | |
virtual | ~Animated () |
Destructor. | |
void | set_animation (const std::string &animation) |
Sets the active animation. | |
nlohmann::json | serialize () override |
Serializes object. | |
void | deserialize (const nlohmann::json &json) override |
Deserializes from object. | |
![]() | |
virtual | ~Serializable () |
Destructor. | |
virtual Serializable & | operator= (Serializable &&)=default |
Move assignment operator. | |
virtual Serializable & | operator= (const Serializable &)=default |
Copy assignment operator. | |
Public Attributes | |
bool | m_paused |
Is the animation paused. | |
double | m_duration |
Time spent on current frame. | |
graphics::Animation * | m_anim |
Animation object. | |
Private Member Functions | |
Animated (const Animated &)=delete | |
Copy constructor. | |
Animated & | operator= (const Animated &)=delete |
Copy assignment operator. | |
Additional Inherited Members | |
![]() | |
Serializable () | |
Constructor. | |
Allows for an entity to be animated.
Definition at line 21 of file Animated.hpp.
galaxy::components::Animated::Animated | ( | ) |
Constructor.
Definition at line 19 of file Animated.cpp.
galaxy::components::Animated::Animated | ( | const nlohmann::json & | json | ) |
JSON constructor.
json | JSON defining object. |
Definition at line 27 of file Animated.cpp.
galaxy::components::Animated::Animated | ( | Animated && | a | ) |
Move constructor.
Definition at line 33 of file Animated.cpp.
|
virtual |
Destructor.
Definition at line 57 of file Animated.cpp.
|
privatedelete |
Copy constructor.
Move assignment operator.
Definition at line 43 of file Animated.cpp.
void galaxy::components::Animated::set_animation | ( | const std::string & | animation | ) |
Sets the active animation.
animation | Animation to use. |
Definition at line 62 of file Animated.cpp.
|
nodiscardoverridevirtual |
Serializes object.
Implements galaxy::fs::Serializable.
Definition at line 68 of file Animated.cpp.
|
overridevirtual |
Deserializes from object.
json | Json object to retrieve data from. |
Implements galaxy::fs::Serializable.
Definition at line 87 of file Animated.cpp.
Copy assignment operator.
bool galaxy::components::Animated::m_paused |
Is the animation paused.
Definition at line 88 of file Animated.hpp.
double galaxy::components::Animated::m_duration |
Time spent on current frame.
Definition at line 93 of file Animated.hpp.
graphics::Animation* galaxy::components::Animated::m_anim |
Animation object.
Definition at line 98 of file Animated.hpp.