Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::Component Class Referenceabstract

Abstract base class for node components. More...

#include <aeongames/Component.hpp>

Inheritance diagram for AeonGames::Component:
Inheritance graph
Collaboration diagram for AeonGames::Component:
Collaboration graph

Public Member Functions

virtual DLL ~Component ()=0
 Pure virtual destructor.
DLL void SetProperty (const StringId &aId, const Property &aProperty)
 Set a property by its StringId identifier.
DLL void SetProperty (const std::string &aId, const Property &aProperty)
 Set a property by its string name.
virtual const StringIdGetId () const =0
 Get the unique identifier for this component type.
virtual size_t GetPropertyCount () const =0
 Get the number of properties exposed by this component.
virtual const StringIdGetPropertyInfoArray () const =0
 Get the array of property identifiers.
virtual Property GetProperty (const StringId &aId) const =0
 Get the value of a property.
virtual void SetProperty (uint32_t aId, const Property &aProperty)=0
 Set the value aProperty for the property identified by aId.
virtual void Update (Node &aNode, double aDelta)=0
 Update the component state.
virtual void Render (const Node &aNode, Renderer &aRenderer, void *aWindowId)=0
 Render the component.
virtual void ProcessMessage (Node &aNode, uint32_t aMessageType, const void *aMessageData)=0
 Process an incoming message.

Detailed Description

Abstract base class for node components.

Components encapsulate reusable behavior and data that can be attached to a Node. Concrete implementations provide domain-specific logic such as rendering, physics, or audio.

Definition at line 38 of file Component.hpp.

Member Function Documentation

◆ GetId()

virtual const StringId & AeonGames::Component::GetId ( ) const
pure virtual

Get the unique identifier for this component type.

Returns
Reference to the component's StringId.

Implemented in AeonGames::Camera, AeonGames::ModelComponent, and AeonGames::PointLight.

◆ GetProperty()

virtual Property AeonGames::Component::GetProperty ( const StringId & aId) const
pure virtual

Get the value of a property.

Parameters
aIdIdentifier of the property to retrieve.
Returns
The property value.

Implemented in AeonGames::Camera, AeonGames::ModelComponent, and AeonGames::PointLight.

◆ GetPropertyCount()

virtual size_t AeonGames::Component::GetPropertyCount ( ) const
pure virtual

Get the number of properties exposed by this component.

Returns
Property count.

Implemented in AeonGames::Camera, AeonGames::ModelComponent, and AeonGames::PointLight.

◆ GetPropertyInfoArray()

virtual const StringId * AeonGames::Component::GetPropertyInfoArray ( ) const
pure virtual

Get the array of property identifiers.

Returns
Pointer to the first element of the property info array.

Implemented in AeonGames::Camera, AeonGames::ModelComponent, and AeonGames::PointLight.

◆ ProcessMessage()

virtual void AeonGames::Component::ProcessMessage ( Node & aNode,
uint32_t aMessageType,
const void * aMessageData )
pure virtual

Process an incoming message.

Parameters
aNodeNode this component is attached to.
aMessageTypeType identifier of the message.
aMessageDataPointer to message-specific data.

Implemented in AeonGames::Camera, AeonGames::ModelComponent, and AeonGames::PointLight.

◆ Render()

virtual void AeonGames::Component::Render ( const Node & aNode,
Renderer & aRenderer,
void * aWindowId )
pure virtual

Render the component.

Parameters
aNodeNode this component is attached to.
aRendererRenderer used for drawing.
aWindowIdPlatform-specific window identifier.

Implemented in AeonGames::Camera, AeonGames::ModelComponent, and AeonGames::PointLight.

◆ SetProperty() [1/3]

void AeonGames::Component::SetProperty ( const std::string & aId,
const Property & aProperty )

Set a property by its string name.

Parameters
aIdName of the property to set.
aPropertyValue to assign to the property.

Definition at line 27 of file Component.cpp.

◆ SetProperty() [2/3]

void AeonGames::Component::SetProperty ( const StringId & aId,
const Property & aProperty )

Set a property by its StringId identifier.

Parameters
aIdIdentifier of the property to set.
aPropertyValue to assign to the property.

Definition at line 23 of file Component.cpp.

◆ SetProperty() [3/3]

virtual void AeonGames::Component::SetProperty ( uint32_t aId,
const Property & aProperty )
pure virtual

Set the value aProperty for the property identified by aId.

Note
If the type of the value passed does not match the expected types no change should be made.

Implemented in AeonGames::Camera, AeonGames::ModelComponent, and AeonGames::PointLight.

◆ Update()

virtual void AeonGames::Component::Update ( Node & aNode,
double aDelta )
pure virtual

Update the component state.

Parameters
aNodeNode this component is attached to.
aDeltaElapsed time since the last update, in seconds.

Implemented in AeonGames::Camera, AeonGames::ModelComponent, and AeonGames::PointLight.


The documentation for this class was generated from the following files: