1 #ifndef _RIVE_NESTED_NUMBER_BASE_HPP_
2 #define _RIVE_NESTED_NUMBER_BASE_HPP_
3 #include "rive/animation/nested_input.hpp"
4 #include "rive/core/field_types/core_double_type.hpp"
6 class NestedNumberBase : public NestedInput {
8 typedef NestedInput Super;
11 static const uint16_t typeKey = 124;
13 /// Helper to quickly determine if a core object extends another without RTTI
15 bool isTypeOf(uint16_t typeKey) const override {
17 case NestedNumberBase::typeKey:
18 case NestedInputBase::typeKey:
19 case ComponentBase::typeKey:
26 uint16_t coreType() const override { return typeKey; }
28 static const uint16_t nestedValuePropertyKey = 239;
31 float m_NestedValue = 0.0f;
34 inline float nestedValue() const { return m_NestedValue; }
35 void nestedValue(float value) {
36 if (m_NestedValue == value) {
39 m_NestedValue = value;
43 Core* clone() const override;
44 void copy(const NestedNumberBase& object) {
45 m_NestedValue = object.m_NestedValue;
46 NestedInput::copy(object);
49 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override {
50 switch (propertyKey) {
51 case nestedValuePropertyKey:
52 m_NestedValue = CoreDoubleType::deserialize(reader);
55 return NestedInput::deserialize(propertyKey, reader);
59 virtual void nestedValueChanged() {}