Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / rive-cpp / include / rive / generated / animation / state_transition_base.hpp
1 #ifndef _RIVE_STATE_TRANSITION_BASE_HPP_
2 #define _RIVE_STATE_TRANSITION_BASE_HPP_
3 #include "rive/animation/state_machine_layer_component.hpp"
4 #include "rive/core/field_types/core_uint_type.hpp"
5 namespace rive {
6     class StateTransitionBase : public StateMachineLayerComponent {
7     protected:
8         typedef StateMachineLayerComponent Super;
9
10     public:
11         static const uint16_t typeKey = 65;
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 StateTransitionBase::typeKey:
18                 case StateMachineLayerComponentBase::typeKey:
19                     return true;
20                 default:
21                     return false;
22             }
23         }
24
25         uint16_t coreType() const override { return typeKey; }
26
27         static const uint16_t stateToIdPropertyKey = 151;
28         static const uint16_t flagsPropertyKey = 152;
29         static const uint16_t durationPropertyKey = 158;
30         static const uint16_t exitTimePropertyKey = 160;
31
32     private:
33         uint32_t m_StateToId = -1;
34         uint32_t m_Flags = 0;
35         uint32_t m_Duration = 0;
36         uint32_t m_ExitTime = 0;
37
38     public:
39         inline uint32_t stateToId() const { return m_StateToId; }
40         void stateToId(uint32_t value) {
41             if (m_StateToId == value) {
42                 return;
43             }
44             m_StateToId = value;
45             stateToIdChanged();
46         }
47
48         inline uint32_t flags() const { return m_Flags; }
49         void flags(uint32_t value) {
50             if (m_Flags == value) {
51                 return;
52             }
53             m_Flags = value;
54             flagsChanged();
55         }
56
57         inline uint32_t duration() const { return m_Duration; }
58         void duration(uint32_t value) {
59             if (m_Duration == value) {
60                 return;
61             }
62             m_Duration = value;
63             durationChanged();
64         }
65
66         inline uint32_t exitTime() const { return m_ExitTime; }
67         void exitTime(uint32_t value) {
68             if (m_ExitTime == value) {
69                 return;
70             }
71             m_ExitTime = value;
72             exitTimeChanged();
73         }
74
75         Core* clone() const override;
76         void copy(const StateTransitionBase& object) {
77             m_StateToId = object.m_StateToId;
78             m_Flags = object.m_Flags;
79             m_Duration = object.m_Duration;
80             m_ExitTime = object.m_ExitTime;
81             StateMachineLayerComponent::copy(object);
82         }
83
84         bool deserialize(uint16_t propertyKey, BinaryReader& reader) override {
85             switch (propertyKey) {
86                 case stateToIdPropertyKey:
87                     m_StateToId = CoreUintType::deserialize(reader);
88                     return true;
89                 case flagsPropertyKey:
90                     m_Flags = CoreUintType::deserialize(reader);
91                     return true;
92                 case durationPropertyKey:
93                     m_Duration = CoreUintType::deserialize(reader);
94                     return true;
95                 case exitTimePropertyKey:
96                     m_ExitTime = CoreUintType::deserialize(reader);
97                     return true;
98             }
99             return StateMachineLayerComponent::deserialize(propertyKey, reader);
100         }
101
102     protected:
103         virtual void stateToIdChanged() {}
104         virtual void flagsChanged() {}
105         virtual void durationChanged() {}
106         virtual void exitTimeChanged() {}
107     };
108 } // namespace rive
109
110 #endif