R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
ecs::PendingDestroy Class Reference

Marker component indicating entity should be destroyed. More...

#include <PendingDestroy.hpp>

Inheritance diagram for ecs::PendingDestroy:
Inheritance graph
Collaboration diagram for ecs::PendingDestroy:
Collaboration graph

Public Member Functions

 PendingDestroy ()
 Default constructor with OutOfBounds reason.
 
 PendingDestroy (DestroyReason reason)
 Constructor with specific reason.
 
 ~PendingDestroy () override=default
 
DestroyReason getReason () const
 Get the destruction reason.
 
ComponentType getType () const override
 Get component type ID.
 
- Public Member Functions inherited from ecs::IComponent
virtual ~IComponent ()=default
 Virtual destructor.
 

Private Attributes

DestroyReason _reason
 

Detailed Description

Marker component indicating entity should be destroyed.

When this component is added to an entity, the server will:

  1. Send an EntityDestroyed message to all clients
  2. Remove the entity from the registry

This allows proper client-side cleanup and prevents interpolation bugs.

Definition at line 34 of file PendingDestroy.hpp.

Constructor & Destructor Documentation

◆ PendingDestroy() [1/2]

ecs::PendingDestroy::PendingDestroy ( )
inline

Default constructor with OutOfBounds reason.

Definition at line 39 of file PendingDestroy.hpp.

◆ PendingDestroy() [2/2]

ecs::PendingDestroy::PendingDestroy ( DestroyReason  reason)
inlineexplicit

Constructor with specific reason.

Parameters
reasonWhy the entity is being destroyed

Definition at line 45 of file PendingDestroy.hpp.

◆ ~PendingDestroy()

ecs::PendingDestroy::~PendingDestroy ( )
overridedefault

Member Function Documentation

◆ getReason()

DestroyReason ecs::PendingDestroy::getReason ( ) const
inline

Get the destruction reason.

Returns
DestroyReason The reason for destruction

Definition at line 53 of file PendingDestroy.hpp.

References _reason.

Referenced by Server::_processPendingDestructions().

◆ getType()

ComponentType ecs::PendingDestroy::getType ( ) const
inlineoverridevirtual

Get component type ID.

Returns
ComponentType The unique ID of this component type

Implements ecs::IComponent.

Definition at line 59 of file PendingDestroy.hpp.

Member Data Documentation

◆ _reason

DestroyReason ecs::PendingDestroy::_reason
private

Definition at line 62 of file PendingDestroy.hpp.

Referenced by getReason().


The documentation for this class was generated from the following file: