e2a780026a040e6d9b37af5a70ea1f40b92caf9a
[platform/core/uifw/rive-tizen.git] / submodule / include / generated / animation / transition_number_condition_base.hpp
1 #ifndef _RIVE_TRANSITION_NUMBER_CONDITION_BASE_HPP_
2 #define _RIVE_TRANSITION_NUMBER_CONDITION_BASE_HPP_
3 #include "animation/transition_value_condition.hpp"
4 #include "core/field_types/core_double_type.hpp"
5 namespace rive
6 {
7         class TransitionNumberConditionBase : public TransitionValueCondition
8         {
9         protected:
10                 typedef TransitionValueCondition Super;
11
12         public:
13                 static const uint16_t typeKey = 70;
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 TransitionNumberConditionBase::typeKey:
22                                 case TransitionValueConditionBase::typeKey:
23                                 case TransitionConditionBase::typeKey:
24                                         return true;
25                                 default:
26                                         return false;
27                         }
28                 }
29
30                 uint16_t coreType() const override { return typeKey; }
31
32                 static const uint16_t valuePropertyKey = 157;
33
34         private:
35                 float m_Value = 0.0f;
36         public:
37                 inline float value() const { return m_Value; }
38                 void value(float value)
39                 {
40                         if (m_Value == value)
41                         {
42                                 return;
43                         }
44                         m_Value = value;
45                         valueChanged();
46                 }
47
48                 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
49                 {
50                         switch (propertyKey)
51                         {
52                                 case valuePropertyKey:
53                                         m_Value = CoreDoubleType::deserialize(reader);
54                                         return true;
55                         }
56                         return TransitionValueCondition::deserialize(propertyKey, reader);
57                 }
58
59         protected:
60                 virtual void valueChanged() {}
61         };
62 } // namespace rive
63
64 #endif