Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / rive-cpp / include / rive / generated / animation / state_machine_bool_base.hpp
1 #ifndef _RIVE_STATE_MACHINE_BOOL_BASE_HPP_
2 #define _RIVE_STATE_MACHINE_BOOL_BASE_HPP_
3 #include "rive/animation/state_machine_input.hpp"
4 #include "rive/core/field_types/core_bool_type.hpp"
5 namespace rive {
6     class StateMachineBoolBase : public StateMachineInput {
7     protected:
8         typedef StateMachineInput Super;
9
10     public:
11         static const uint16_t typeKey = 59;
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 StateMachineBoolBase::typeKey:
18                 case StateMachineInputBase::typeKey:
19                 case StateMachineComponentBase::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 valuePropertyKey = 141;
29
30     private:
31         bool m_Value = false;
32
33     public:
34         inline bool value() const { return m_Value; }
35         void value(bool value) {
36             if (m_Value == value) {
37                 return;
38             }
39             m_Value = value;
40             valueChanged();
41         }
42
43         Core* clone() const override;
44         void copy(const StateMachineBoolBase& object) {
45             m_Value = object.m_Value;
46             StateMachineInput::copy(object);
47         }
48
49         bool deserialize(uint16_t propertyKey, BinaryReader& reader) override {
50             switch (propertyKey) {
51                 case valuePropertyKey:
52                     m_Value = CoreBoolType::deserialize(reader);
53                     return true;
54             }
55             return StateMachineInput::deserialize(propertyKey, reader);
56         }
57
58     protected:
59         virtual void valueChanged() {}
60     };
61 } // namespace rive
62
63 #endif