ECSM v0.2.0
Entityfinal

An object containing components. More...

#include <ecsm.hpp>

Public Types

using SystemComponent = std::pair<System*, ID<Component>>
 
using Components = std::map<std::type_index, SystemComponent>
 

Public Member Functions

bool destroy ()
 Destroys all entity components.
 
const ComponentsgetComponents () const noexcept
 Returns entity components map.
 

Friends

class Manager
 

Detailed Description

An object containing components.

The entity is a general-purpose object. It doesn't have any inherent behavior or data by itself. Instead, it serves as a container for components.

Member Function Documentation

◆ destroy()

bool destroy ( )

Destroys all entity components.

Note
Components are not destroyed immediately, only after the dispose call.

◆ getComponents()

const Components & getComponents ( ) const
inlinenoexcept

Returns entity components map.

Use Manager to add or remove components.