Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / rive-cpp / include / rive / generated / animation / nested_number_base.hpp
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"
5 namespace rive {
6     class NestedNumberBase : public NestedInput {
7     protected:
8         typedef NestedInput Super;
9
10     public:
11         static const uint16_t typeKey = 124;
12
13         /// Helper to quickly determine if a core object extends another without RTTI
14         /// at runtime.
15         bool isTypeOf(uint16_t typeKey) const override {
16             switch (typeKey) {
17                 case NestedNumberBase::typeKey:
18                 case NestedInputBase::typeKey:
19                 case ComponentBase::typeKey:
20                     return true;
21                 default:
22                     return false;
23             }
24         }
25
26         uint16_t coreType() const override { return typeKey; }
27
28         static const uint16_t nestedValuePropertyKey = 239;
29
30     private:
31         float m_NestedValue = 0.0f;
32
33     public:
34         inline float nestedValue() const { return m_NestedValue; }
35         void nestedValue(float value) {
36             if (m_NestedValue == value) {
37                 return;
38             }
39             m_NestedValue = value;
40             nestedValueChanged();
41         }
42
43         Core* clone() const override;
44         void copy(const NestedNumberBase& object) {
45             m_NestedValue = object.m_NestedValue;
46             NestedInput::copy(object);
47         }
48
49         bool deserialize(uint16_t propertyKey, BinaryReader& reader) override {
50             switch (propertyKey) {
51                 case nestedValuePropertyKey:
52                     m_NestedValue = CoreDoubleType::deserialize(reader);
53                     return true;
54             }
55             return NestedInput::deserialize(propertyKey, reader);
56         }
57
58     protected:
59         virtual void nestedValueChanged() {}
60     };
61 } // namespace rive
62
63 #endif