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 int typeKey = 2;
15 /// Helper to quickly determine if a core object extends another without
17 bool isTypeOf(int typeKey) const override
21 case NodeBase::typeKey:
22 case TransformComponentBase::typeKey:
23 case ContainerComponentBase::typeKey:
24 case ComponentBase::typeKey:
31 int coreType() const override { return typeKey; }
33 static const int xPropertyKey = 13;
34 static const int yPropertyKey = 14;
40 inline float x() const override { return m_X; }
51 inline float y() const override { return m_Y; }
62 bool deserialize(int propertyKey, BinaryReader& reader) override
67 m_X = CoreDoubleType::deserialize(reader);
70 m_Y = CoreDoubleType::deserialize(reader);
73 return TransformComponent::deserialize(propertyKey, reader);
77 virtual void xChanged() {}
78 virtual void yChanged() {}