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

Command to try add multiple components (only missing ones). More...

#include <commands.hpp>

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

Public Member Functions

constexpr TryAddComponentsCmd (const TryAddComponentsCmd &) noexcept=default
 
constexpr TryAddComponentsCmd (TryAddComponentsCmd &&) noexcept=default
 
constexpr ~TryAddComponentsCmd () noexcept override=default
 
constexpr TryAddComponentsCmdoperator= (const TryAddComponentsCmd &) noexcept=default
 
constexpr TryAddComponentsCmdoperator= (TryAddComponentsCmd &&) noexcept=default
 
void Execute (World &world) override
 Executes components addition if entity is missing 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::TryAddComponentsCmd< Ts >

Command to try add multiple components (only missing ones).

Template Parameters
TsComponent types (must be unique)

Definition at line 388 of file commands.hpp.

Constructor & Destructor Documentation

◆ TryAddComponentsCmd() [1/2]

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

◆ TryAddComponentsCmd() [2/2]

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

◆ ~TryAddComponentsCmd()

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

Member Function Documentation

◆ Execute()

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

Executes components addition if entity is missing them.

Parameters
worldWorld to add components in

Implements helios::ecs::Command.

Definition at line 432 of file commands.hpp.

432 {
433 std::apply([&world, this](auto&&... args) { world.TryAddComponents(entity_, std::forward<decltype(args)>(args)...); },
434 std::move(components_));
435}
BasicQuery< World, Allocator, Components... > Query
Type alias for query with mutable world access.
Definition query.hpp:2481

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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