32#ifndef DVD_SGN_COMPONENT_H_
33#define DVD_SGN_COMPONENT_H_
46class SceneRenderState;
47struct RenderStagePass;
85template<
class T,
typename... Args>
91template <
typename Base,
typename... Args>
98 template <
typename... ConstructArgs>
107 template <
typename T, ComponentType C>
111 template<
typename... InnerArgs>
124 AddSGNComponent<T, Args...>(node, FWD(args)...);
130 RemoveSGNComponent<T>( node );
149 template <
typename T, ComponentType C>
168template <
typename Base,
typename... Args>
169template <
typename T, ComponentType C>
170bool Factory<Base, Args...>::Registrar<T, C>::s_registered = RegisterComponentType();
172struct EntityOnUpdate;
182 virtual void saveToXML(boost::property_tree::ptree& pt)
const;
183 virtual void loadFromXML(
const boost::property_tree::ptree& pt);
190 [[nodiscard]]
virtual bool enabled()
const;
191 virtual void enabled(
bool state);
206template<
typename T, ComponentType C>
209#define INIT_COMPONENT(X) static bool X##_registered = X::s_registered
211#define DVD_COMPONENT_SIGNATURE(Name, Enum) class Name##Component final : public BaseComponentType<Name##Component, Enum>
213#define DVD_COMPONENT_PARENT(Name, Enum) using Parent = BaseComponentType<Name##Component, Enum>; \
214 friend class Name##System;
215#define BEGIN_COMPONENT(Name, Enum) \
216 DVD_COMPONENT_SIGNATURE(Name, Enum) { \
217 DVD_COMPONENT_PARENT(Name, Enum)
219#define BEGIN_COMPONENT_EXT1(Name, Enum, Base1) \
220 DVD_COMPONENT_SIGNATURE(Name, Enum) , public Base1 { \
221 DVD_COMPONENT_PARENT(Name, Enum)
223#define END_COMPONENT(Name) \
225 INIT_COMPONENT(Name##Component);
PlatformContext & context() noexcept
POINTER_R_IW(SceneGraphNode, parentSGN, nullptr)
virtual void saveToXML(boost::property_tree::ptree &pt) const
virtual bool enabled() const
std::atomic_bool _enabled
virtual void loadFromXML(const boost::property_tree::ptree &pt)
PROPERTY_R(EditorComponent, editorComponent)
virtual void OnData(const ECS::CustomEvent &data)
virtual bool saveCache(ByteBuffer &outputBuffer) const
EditorComponent & editorComponent() noexcept
PROPERTY_R_IW(ComponentType, type, ComponentType::COUNT)
std::atomic_bool _hasChanged
virtual bool loadCache(ByteBuffer &inputBuffer)
constexpr T Base(T a)
Base value.
Handle console commands that start with a forward slash.
std::function< Ret(Args...) > DELEGATE_STD
SGNComponent::Registrar< T, C > BaseComponentType
void AddSGNComponent(SceneGraphNode *node, Args... args)
void RemoveSGNComponent(SceneGraphNode *node)
Key(const bool registered) noexcept
void OnData(const ECS::CustomEvent &data) override
static bool RegisterComponentType()
Registrar(InnerArgs &&... args)
static void destruct(const ComponentType type, SceneGraphNode *node)
static FactoryContainerConstruct & constructData()
DELEGATE_STD< void, SceneGraphNode *, Args... > ConstructFunc
ska::bytell_hash_map< ComponentType, ConstructFunc > FactoryContainerConstruct
DELEGATE_STD< void, SceneGraphNode * > DestructFunc
static void construct(ComponentType type, SceneGraphNode *node, ConstructArgs &&... args)
static FactoryContainerDestruct & destructData()
ska::bytell_hash_map< ComponentType, DestructFunc > FactoryContainerDestruct
@ RelationshipCacheInvalidated
Divide::SGNComponent * _sourceCmp