1 #ifndef _RIVE_ANIMATION_STATE_BASE_HPP_
2 #define _RIVE_ANIMATION_STATE_BASE_HPP_
3 #include "animation/layer_state.hpp"
4 #include "core/field_types/core_uint_type.hpp"
7 class AnimationStateBase : public LayerState
10 typedef LayerState Super;
13 static const uint16_t typeKey = 61;
15 /// Helper to quickly determine if a core object extends another without
17 bool isTypeOf(uint16_t typeKey) const override
21 case AnimationStateBase::typeKey:
22 case LayerStateBase::typeKey:
23 case StateMachineLayerComponentBase::typeKey:
30 uint16_t coreType() const override { return typeKey; }
32 static const uint16_t animationIdPropertyKey = 149;
35 int m_AnimationId = -1;
37 inline int animationId() const { return m_AnimationId; }
38 void animationId(int value)
40 if (m_AnimationId == value)
44 m_AnimationId = value;
48 Core* clone() const override;
49 void copy(const AnimationStateBase& object)
51 m_AnimationId = object.m_AnimationId;
52 LayerState::copy(object);
55 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
59 case animationIdPropertyKey:
60 m_AnimationId = CoreUintType::deserialize(reader);
63 return LayerState::deserialize(propertyKey, reader);
67 virtual void animationIdChanged() {}