16#ifndef AEONGAMES_COMPONENT_H
17#define AEONGAMES_COMPONENT_H
24#include "aeongames/StringId.hpp"
91 virtual void ProcessMessage (
Node& aNode, uint32_t aMessageType,
const void* aMessageData ) = 0;
Defines the Property variant type used for generic value storage.
Abstract base class for node components.
virtual void SetProperty(uint32_t aId, const Property &aProperty)=0
Set the value aProperty for the property identified by aId.
DLL void SetProperty(const StringId &aId, const Property &aProperty)
Set a property by its StringId identifier.
virtual DLL ~Component()=0
Pure virtual destructor.
virtual size_t GetPropertyCount() const =0
Get the number of properties exposed by this component.
virtual void Render(const Node &aNode, Renderer &aRenderer, void *aWindowId)=0
Render the component.
virtual const StringId & GetId() const =0
Get the unique identifier for this component type.
virtual Property GetProperty(const StringId &aId) const =0
Get the value of a property.
virtual const StringId * GetPropertyInfoArray() const =0
Get the array of property identifiers.
virtual void ProcessMessage(Node &aNode, uint32_t aMessageType, const void *aMessageData)=0
Process an incoming message.
virtual void Update(Node &aNode, double aDelta)=0
Update the component state.
Scene graph node representing an entity in the game world.
Abstract base class for rendering backends.
CRC-based compile-time string identifier.
<- This is here just for the literals
DLL bool RegisterComponentConstructor(const StringId &aIdentifier, const std::function< std::unique_ptr< Component >() > &aConstructor)
Registers a Component loader for a specific identifier.
std::variant< int, long, long long, unsigned, unsigned long, unsigned long long, float, double, std::string, std::filesystem::path > Property
A variant type that can hold any commonly used property value.
DLL std::unique_ptr< Component > ConstructComponent(uint32_t aIdentifier)
Construct a component from a numeric identifier.
DLL void EnumerateComponentConstructors(const std::function< bool(const StringId &) > &aEnumerator)
Enumerates Component loader identifiers via an enumerator functor.
DLL bool UnregisterComponentConstructor(const StringId &aIdentifier)
Unregisters a Component loader for a specific identifier.