1 #ifndef _RIVE_NODE_BASE_HPP_
2 #define _RIVE_NODE_BASE_HPP_
3 #include "core/field_types/core_double_type.hpp"
4 #include "transform_component.hpp"
7 class NodeBase : public TransformComponent
10 typedef TransformComponent Super;
13 static const uint16_t typeKey = 2;
15 /// Helper to quickly determine if a core object extends another without
17 bool isTypeOf(uint16_t typeKey) const override
21 case NodeBase::typeKey:
22 case TransformComponentBase::typeKey:
23 case ContainerComponentBase::typeKey:
24 case ComponentBase::typeKey:
31 uint16_t coreType() const override { return typeKey; }
33 static const uint16_t xPropertyKey = 13;
34 static const uint16_t yPropertyKey = 14;
40 inline float x() const override { return m_X; }
51 inline float y() const override { return m_Y; }
62 Core* clone() const override;
63 void copy(const NodeBase& object)
67 TransformComponent::copy(object);
70 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
75 m_X = CoreDoubleType::deserialize(reader);
78 m_Y = CoreDoubleType::deserialize(reader);
81 return TransformComponent::deserialize(propertyKey, reader);
85 virtual void xChanged() {}
86 virtual void yChanged() {}