up-to-date submodule(rive-cpp)
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / bones / weight_base.hpp
1 #ifndef _RIVE_WEIGHT_BASE_HPP_
2 #define _RIVE_WEIGHT_BASE_HPP_
3 #include "component.hpp"
4 #include "core/field_types/core_uint_type.hpp"
5 namespace rive
6 {
7         class WeightBase : public Component
8         {
9         protected:
10                 typedef Component Super;
11
12         public:
13                 static const uint16_t typeKey = 45;
14
15                 /// Helper to quickly determine if a core object extends another without
16                 /// RTTI at runtime.
17                 bool isTypeOf(uint16_t typeKey) const override
18                 {
19                         switch (typeKey)
20                         {
21                                 case WeightBase::typeKey:
22                                 case ComponentBase::typeKey:
23                                         return true;
24                                 default:
25                                         return false;
26                         }
27                 }
28
29                 uint16_t coreType() const override { return typeKey; }
30
31                 static const uint16_t valuesPropertyKey = 102;
32                 static const uint16_t indicesPropertyKey = 103;
33
34         private:
35                 int m_Values = 255;
36                 int m_Indices = 1;
37         public:
38                 inline int values() const { return m_Values; }
39                 void values(int value)
40                 {
41                         if (m_Values == value)
42                         {
43                                 return;
44                         }
45                         m_Values = value;
46                         valuesChanged();
47                 }
48
49                 inline int indices() const { return m_Indices; }
50                 void indices(int value)
51                 {
52                         if (m_Indices == value)
53                         {
54                                 return;
55                         }
56                         m_Indices = value;
57                         indicesChanged();
58                 }
59
60                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
61                 {
62                         switch (propertyKey)
63                         {
64                                 case valuesPropertyKey:
65                                         m_Values = CoreUintType::deserialize(reader);
66                                         return true;
67                                 case indicesPropertyKey:
68                                         m_Indices = CoreUintType::deserialize(reader);
69                                         return true;
70                         }
71                         return Component::deserialize(propertyKey, reader);
72                 }
73
74         protected:
75                 virtual void valuesChanged() {}
76                 virtual void indicesChanged() {}
77         };
78 } // namespace rive
79
80 #endif