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

Command to clear all components from an entity. More...

#include <commands.hpp>

Inheritance diagram for helios::ecs::details::ClearComponentsCmd:
helios::ecs::Command

Public Member Functions

constexpr ClearComponentsCmd (Entity entity) noexcept
 Constructs clear components command.
 
constexpr ClearComponentsCmd (const ClearComponentsCmd &) noexcept=default
 
constexpr ClearComponentsCmd (ClearComponentsCmd &&) noexcept=default
 
constexpr ~ClearComponentsCmd () noexcept override=default
 
constexpr ClearComponentsCmdoperator= (const ClearComponentsCmd &) noexcept=default
 
constexpr ClearComponentsCmdoperator= (ClearComponentsCmd &&) noexcept=default
 
void Execute (World &world) override
 Executes component clearing.
 
- Public Member Functions inherited from helios::ecs::Command
virtual constexpr ~Command () noexcept=default
 

Detailed Description

Command to clear all components from an entity.

Removes all components from the specified entity during execution.

Definition at line 591 of file commands.hpp.

Constructor & Destructor Documentation

◆ ClearComponentsCmd() [1/3]

constexpr helios::ecs::details::ClearComponentsCmd::ClearComponentsCmd ( Entity  entity)
explicitconstexprnoexcept

Constructs clear components command.

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

Definition at line 616 of file commands.hpp.

616 : entity_(entity) {
617 HELIOS_ASSERT(entity.Valid(), "Failed to construct clear components command: Entity with index '{}' is invalid!",
618 entity.Index());
619}
#define HELIOS_ASSERT(condition,...)
Assertion macro that aborts execution in debug builds.
Definition assert.hpp:140

◆ ClearComponentsCmd() [2/3]

constexpr helios::ecs::details::ClearComponentsCmd::ClearComponentsCmd ( const ClearComponentsCmd )
constexprdefaultnoexcept

◆ ClearComponentsCmd() [3/3]

constexpr helios::ecs::details::ClearComponentsCmd::ClearComponentsCmd ( ClearComponentsCmd &&  )
constexprdefaultnoexcept

◆ ~ClearComponentsCmd()

constexpr helios::ecs::details::ClearComponentsCmd::~ClearComponentsCmd ( )
constexproverridedefaultnoexcept

Member Function Documentation

◆ Execute()

void helios::ecs::details::ClearComponentsCmd::Execute ( World world)
inlineoverridevirtual

Executes component clearing.

Parameters
worldWorld to clear components in

Implements helios::ecs::Command.

Definition at line 610 of file commands.hpp.

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

◆ operator=() [1/2]

constexpr ClearComponentsCmd & helios::ecs::details::ClearComponentsCmd::operator= ( ClearComponentsCmd &&  )
constexprdefaultnoexcept

◆ operator=() [2/2]

constexpr ClearComponentsCmd & helios::ecs::details::ClearComponentsCmd::operator= ( const ClearComponentsCmd )
constexprdefaultnoexcept