Helios Engine 0.1.0
A modular ECS based data-oriented C++23 game engine
 
Loading...
Searching...
No Matches
helios::ecs::details::RemoveComponentCmd< T > Class Template Referencefinal

Command to remove a component from an entity. More...

#include <commands.hpp>

Inheritance diagram for helios::ecs::details::RemoveComponentCmd< T >:
helios::ecs::Command

Public Member Functions

constexpr RemoveComponentCmd (Entity entity) noexcept
 Constructs remove component command.
 
constexpr RemoveComponentCmd (const RemoveComponentCmd &) noexcept=default
 
constexpr RemoveComponentCmd (RemoveComponentCmd &&) noexcept=default
 
constexpr ~RemoveComponentCmd () noexcept override=default
 
constexpr RemoveComponentCmdoperator= (const RemoveComponentCmd &) noexcept=default
 
constexpr RemoveComponentCmdoperator= (RemoveComponentCmd &&) noexcept=default
 
void Execute (World &world) override
 Executes component removal.
 
- Public Member Functions inherited from helios::ecs::Command
virtual constexpr ~Command () noexcept=default
 

Detailed Description

template<ComponentTrait T>
class helios::ecs::details::RemoveComponentCmd< T >

Command to remove a component from an entity.

Removes component of type T from the specified entity during execution.

Template Parameters
TComponent type to remove

Definition at line 443 of file commands.hpp.

Constructor & Destructor Documentation

◆ RemoveComponentCmd() [1/3]

template<ComponentTrait T>
constexpr helios::ecs::details::RemoveComponentCmd< T >::RemoveComponentCmd ( Entity  entity)
explicitconstexprnoexcept

Constructs remove component command.

Warning
Triggers assertion if entity is invalid.
Parameters
entityEntity to remove component from

Definition at line 469 of file commands.hpp.

469 : entity_(entity) {
470 HELIOS_ASSERT(entity.Valid(), "Failed to construct remove component command: Entity with index '{}' is invalid!",
471 entity.Index());
472}
#define HELIOS_ASSERT(condition,...)
Assertion macro that aborts execution in debug builds.
Definition assert.hpp:140

◆ RemoveComponentCmd() [2/3]

template<ComponentTrait T>
constexpr helios::ecs::details::RemoveComponentCmd< T >::RemoveComponentCmd ( const RemoveComponentCmd< T > &  )
constexprdefaultnoexcept

◆ RemoveComponentCmd() [3/3]

template<ComponentTrait T>
constexpr helios::ecs::details::RemoveComponentCmd< T >::RemoveComponentCmd ( RemoveComponentCmd< T > &&  )
constexprdefaultnoexcept

◆ ~RemoveComponentCmd()

template<ComponentTrait T>
constexpr helios::ecs::details::RemoveComponentCmd< T >::~RemoveComponentCmd ( )
constexproverridedefaultnoexcept

Member Function Documentation

◆ Execute()

template<ComponentTrait T>
void helios::ecs::details::RemoveComponentCmd< T >::Execute ( World world)
inlineoverridevirtual

Executes component removal.

Parameters
worldWorld to remove component from

Implements helios::ecs::Command.

Definition at line 462 of file commands.hpp.

462{ world.RemoveComponent<T>(entity_); }
BasicQuery< World, Allocator, Components... > Query
Type alias for query with mutable world access.
Definition query.hpp:2481

◆ operator=() [1/2]

template<ComponentTrait T>
constexpr RemoveComponentCmd & helios::ecs::details::RemoveComponentCmd< T >::operator= ( const RemoveComponentCmd< T > &  )
constexprdefaultnoexcept

◆ operator=() [2/2]

template<ComponentTrait T>
constexpr RemoveComponentCmd & helios::ecs::details::RemoveComponentCmd< T >::operator= ( RemoveComponentCmd< T > &&  )
constexprdefaultnoexcept