Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
rtp::ecs::ISparseArray Class Referenceabstract

Type-erased base interface for sparse arrays. More...

#include <SparseArray.hpp>

Inheritance diagram for rtp::ecs::ISparseArray:
Collaboration diagram for rtp::ecs::ISparseArray:

Public Member Functions

virtual ~ISparseArray () noexcept=default
 
virtual void erase (Entity entity)=0
 Remove a component from an entity.
 
virtual bool has (Entity entity) const =0
 Check if an entity has a component.
 
virtual void clear (void)=0
 Remove all components.
 

Detailed Description

Type-erased base interface for sparse arrays.

Allows storing sparse arrays of different component types in a uniform container through type erasure.

Definition at line 61 of file SparseArray.hpp.

Constructor & Destructor Documentation

◆ ~ISparseArray()

virtual rtp::ecs::ISparseArray::~ISparseArray ( )
virtualdefaultnoexcept

Member Function Documentation

◆ clear()

virtual void rtp::ecs::ISparseArray::clear ( void  )
pure virtual

Remove all components.

Implemented in rtp::ecs::SparseArray< T >.

◆ erase()

virtual void rtp::ecs::ISparseArray::erase ( Entity  entity)
pure virtual

Remove a component from an entity.

Parameters
entityThe entity whose component to remove

Implemented in rtp::ecs::SparseArray< T >.

◆ has()

virtual bool rtp::ecs::ISparseArray::has ( Entity  entity) const
pure virtual

Check if an entity has a component.

Parameters
entityThe entity to check
Returns
true if the entity has this component

Implemented in rtp::ecs::SparseArray< T >.


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