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"
6 class StateMachineBoolBase : public StateMachineInput {
8 typedef StateMachineInput Super;
11 static const uint16_t typeKey = 59;
13 /// Helper to quickly determine if a core object extends another without RTTI
15 bool isTypeOf(uint16_t typeKey) const override {
17 case StateMachineBoolBase::typeKey:
18 case StateMachineInputBase::typeKey:
19 case StateMachineComponentBase::typeKey:
26 uint16_t coreType() const override { return typeKey; }
28 static const uint16_t valuePropertyKey = 141;
34 inline bool value() const { return m_Value; }
35 void value(bool value) {
36 if (m_Value == value) {
43 Core* clone() const override;
44 void copy(const StateMachineBoolBase& object) {
45 m_Value = object.m_Value;
46 StateMachineInput::copy(object);
49 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override {
50 switch (propertyKey) {
51 case valuePropertyKey:
52 m_Value = CoreBoolType::deserialize(reader);
55 return StateMachineInput::deserialize(propertyKey, reader);
59 virtual void valueChanged() {}