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

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

#include <builtin_commands.hpp>

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=default
constexpr TryRemoveComponentsCmdoperator= (const TryRemoveComponentsCmd &) noexcept=default
constexpr TryRemoveComponentsCmdoperator= (TryRemoveComponentsCmd &&) noexcept=default
void Execute (World &world)
 Executes components removal if entity has them.

Detailed Description

template<ComponentTrait... Ts>
requires utils::UniqueTypes<Ts...> && (sizeof...(Ts) > 0)
class helios::ecs::TryRemoveComponentsCmd< Ts >

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

Removes multiple components from the specified entity during execution only if they exist.

Warning
Will trigger assertion if the entity does not exist in the world (when world updated).
Template Parameters
TsComponent types (must be unique)

Definition at line 398 of file builtin_commands.hpp.

Constructor & Destructor Documentation

◆ TryRemoveComponentsCmd() [1/3]

template<ComponentTrait... Ts>
helios::ecs::TryRemoveComponentsCmd< Ts >::TryRemoveComponentsCmd ( Entity entity)
inlineexplicitconstexprnoexcept

Constructs try remove components command.

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

Definition at line 405 of file builtin_commands.hpp.

◆ TryRemoveComponentsCmd() [2/3]

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

◆ TryRemoveComponentsCmd() [3/3]

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

◆ ~TryRemoveComponentsCmd()

template<ComponentTrait... Ts>
helios::ecs::TryRemoveComponentsCmd< Ts >::~TryRemoveComponentsCmd ( )
constexprdefaultnoexcept

Member Function Documentation

◆ Execute()

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

Executes components removal if entity has them.

Warning
Triggers assertion if the entity does not exist in the world.
Parameters
worldWorld to remove components from

Definition at line 425 of file builtin_commands.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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