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

Command to add multiple components to an entity. More...

#include <commands.hpp>

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

Public Member Functions

constexpr AddComponentsCmd (const AddComponentsCmd &) noexcept=default
 
constexpr AddComponentsCmd (AddComponentsCmd &&) noexcept=default
 
constexpr ~AddComponentsCmd () noexcept override=default
 
constexpr AddComponentsCmdoperator= (const AddComponentsCmd &) noexcept=default
 
constexpr AddComponentsCmdoperator= (AddComponentsCmd &&) noexcept=default
 
void Execute (World &world) override
 Executes components addition.
 
- 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::AddComponentsCmd< Ts >

Command to add multiple components to an entity.

Efficiently adds multiple components in a single operation.

Template Parameters
TsComponent types to add (must be unique)

Definition at line 283 of file commands.hpp.

Constructor & Destructor Documentation

◆ AddComponentsCmd() [1/2]

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

◆ AddComponentsCmd() [2/2]

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

◆ ~AddComponentsCmd()

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

Member Function Documentation

◆ Execute()

template<ComponentTrait... Ts>
requires utils::UniqueTypes<Ts...>
void helios::ecs::details::AddComponentsCmd< Ts >::Execute ( World world)
inlineoverridevirtual

Executes components addition.

Parameters
worldWorld to add components in

Implements helios::ecs::Command.

Definition at line 321 of file commands.hpp.

321 {
322 std::apply([&world, this](auto&&... args) { world.AddComponents(entity_, std::forward<decltype(args)>(args)...); },
323 std::move(components_));
324}
BasicQuery< World, Allocator, Components... > Query
Type alias for query with mutable world access.
Definition query.hpp:2481

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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