wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
Loading...
Searching...
No Matches
wEngine::Component Class Reference

Abstract base class for all ECS components. More...

#include <wComponent.hpp>

Inheritance diagram for wEngine::Component:
Inheritance graph

Public Member Functions

virtual ~Component ()=default
virtual void enable ()
virtual void disable ()
bool isEnabled () const
 Checks whether the component is currently active.
void setParent (Entity *parent)
 Sets the parent entity of this component.
EntitygetParent () const
 Returns the parent entity of this component.

Protected Member Functions

 Component ()
 Protected constructor to restrict instantiation to derived classes.

Detailed Description

Abstract base class for all ECS components.

Defines the minimal interface required by any component: activation control and access to its owning entity.

Intended to be subclassed by specific component implementations.

Created by Wilfried Koch.
Copyright @ 2025 Wilfried Koch. All rights reserved.

Constructor & Destructor Documentation

◆ ~Component()

virtual wEngine::Component::~Component ( )
virtualdefault

◆ Component()

wEngine::Component::Component ( )
protected

Protected constructor to restrict instantiation to derived classes.

Member Function Documentation

◆ enable()

void wEngine::Component::enable ( )
virtual

◆ disable()

void wEngine::Component::disable ( )
virtual

◆ isEnabled()

bool wEngine::Component::isEnabled ( ) const
nodiscard

Checks whether the component is currently active.

Returns
True if enabled, false if disabled.

◆ setParent()

void wEngine::Component::setParent ( Entity * parent)

Sets the parent entity of this component.

Parameters
parentA pointer to the entity that owns this component.

◆ getParent()

Entity * wEngine::Component::getParent ( ) const
nodiscard

Returns the parent entity of this component.

Returns
Pointer to the owning Entity.

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