8#include <nlohmann/json.hpp>
10#include "galaxy/core/ServiceLocator.hpp"
64 auto& cache = core::ServiceLocator<resource::Animations>::ref();
65 m_anim = cache.get(animation);
70 nlohmann::json json =
"{}"_json;
77 json[
"animation"] =
m_anim->m_name;
81 json[
"no_animation"] =
true;
92 if (!(json.count(
"no_animation") > 0))
Allows for an entity to be animated.
virtual ~Animated()
Destructor.
graphics::Animation * m_anim
Animation object.
Animated & operator=(Animated &&)
Move assignment operator.
void set_animation(const std::string &animation)
Sets the active animation.
double m_duration
Time spent on current frame.
bool m_paused
Is the animation paused.
void deserialize(const nlohmann::json &json) override
Deserializes from object.
nlohmann::json serialize() override
Serializes object.