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

Command to try remove multiple components (only those present). More...

#include <commands.hpp>

Inheritance diagram for helios::ecs::details::TryRemoveComponentsCmd< Ts >:
helios::ecs::Command

Public Member Functions

constexpr TryRemoveComponentsCmd (Entity entity) noexcept
 Constructs try remove components command.
 
constexpr TryRemoveComponentsCmd (const TryRemoveComponentsCmd &) noexcept=default
 
constexpr TryRemoveComponentsCmd (TryRemoveComponentsCmd &&) noexcept=default
 
constexpr ~TryRemoveComponentsCmd () noexcept override=default
 
constexpr TryRemoveComponentsCmdoperator= (const TryRemoveComponentsCmd &) noexcept=default
 
constexpr TryRemoveComponentsCmdoperator= (TryRemoveComponentsCmd &&) noexcept=default
 
void Execute (World &world) override
 Executes components removal if entity has them.
 
- Public Member Functions inherited from helios::ecs::Command
virtual constexpr ~Command () noexcept=default
 

Detailed Description

template<ComponentTrait... Ts>
requires utils::UniqueTypes<Ts...>
class helios::ecs::details::TryRemoveComponentsCmd< Ts >

Command to try remove multiple components (only those present).

Template Parameters
TsComponent types (must be unique)

Definition at line 555 of file commands.hpp.

Constructor & Destructor Documentation

◆ TryRemoveComponentsCmd() [1/3]

template<ComponentTrait... Ts>
requires utils::UniqueTypes<Ts...>
constexpr helios::ecs::details::TryRemoveComponentsCmd< Ts >::TryRemoveComponentsCmd ( Entity  entity)
explicitconstexprnoexcept

Constructs try remove components command.

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

Definition at line 582 of file commands.hpp.

582 : entity_(entity) {
583 HELIOS_ASSERT(entity.Valid(), "Failed to construct try remove components command: Entity with index '{}' is invalid!",
584 entity.Index());
585}
#define HELIOS_ASSERT(condition,...)
Assertion macro that aborts execution in debug builds.
Definition assert.hpp:140

◆ TryRemoveComponentsCmd() [2/3]

template<ComponentTrait... Ts>
constexpr helios::ecs::details::TryRemoveComponentsCmd< Ts >::TryRemoveComponentsCmd ( const TryRemoveComponentsCmd< Ts > &  )
constexprdefaultnoexcept

◆ TryRemoveComponentsCmd() [3/3]

template<ComponentTrait... Ts>
constexpr helios::ecs::details::TryRemoveComponentsCmd< Ts >::TryRemoveComponentsCmd ( TryRemoveComponentsCmd< Ts > &&  )
constexprdefaultnoexcept

◆ ~TryRemoveComponentsCmd()

template<ComponentTrait... Ts>
constexpr helios::ecs::details::TryRemoveComponentsCmd< Ts >::~TryRemoveComponentsCmd ( )
constexproverridedefaultnoexcept

Member Function Documentation

◆ Execute()

template<ComponentTrait... Ts>
void helios::ecs::details::TryRemoveComponentsCmd< Ts >::Execute ( World world)
inlineoverridevirtual

Executes components removal if entity has them.

Parameters
worldWorld to remove components from

Implements helios::ecs::Command.

Definition at line 574 of file commands.hpp.

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

◆ operator=() [1/2]

template<ComponentTrait... Ts>
constexpr TryRemoveComponentsCmd & helios::ecs::details::TryRemoveComponentsCmd< Ts >::operator= ( const TryRemoveComponentsCmd< Ts > &  )
constexprdefaultnoexcept

◆ operator=() [2/2]

template<ComponentTrait... Ts>
constexpr TryRemoveComponentsCmd & helios::ecs::details::TryRemoveComponentsCmd< Ts >::operator= ( TryRemoveComponentsCmd< Ts > &&  )
constexprdefaultnoexcept