EmittedByComponent Class
Component that tracks which entity emitted/spawned this object. More...
Declaration
Public Constructors Index
| EmittedByComponent ()=default | |
|
Default constructor. More... | |
| EmittedByComponent (const EmittedByComponent &other) | |
|
Copy constructor (creates empty state). More... | |
| EmittedByComponent (EmittedByComponent &&) noexcept=default | |
Public Operators Index
| EmittedByComponent & | operator= (const EmittedByComponent &)=default |
| EmittedByComponent & | operator= (EmittedByComponent &&) noexcept=default |
Public Member Functions Index
| bool | isEnabled () const noexcept |
|
Checks whether this component is enabled. More... | |
| void | enable () noexcept |
|
Enables this component. More... | |
| void | disable () noexcept |
|
Disables this component. More... | |
| void | setSource (const helios::engine::ecs::EntityHandle source) noexcept |
|
Sets the source entity that emitted this object. More... | |
| helios::engine::ecs::EntityHandle | source () const noexcept |
|
Returns the handle of the source entity. More... | |
| void | reset () |
|
Resets the component to its initial state. More... | |
| void | onAcquire () noexcept |
|
Called when this entity is acquired from a pool. More... | |
| void | onRelease () noexcept |
|
Called when this entity is released back to a pool. More... | |
Private Member Attributes Index
| helios::engine::ecs::EntityHandle | source_ {} |
|
Handle of the entity that emitted this object. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component that tracks which entity emitted/spawned this object.
Used to establish a relationship between a spawned entity (e.g., a projectile) and its source entity (e.g., the player or enemy that fired it). This enables game logic to attribute actions like damage or scoring to the correct source.
Definition at line 26 of file EmittedByComponent.ixx.
Public Constructors
EmittedByComponent()
| default |
Default constructor.
Definition at line 66 of file EmittedByComponent.ixx.
Referenced by EmittedByComponent, EmittedByComponent, operator= and operator=.
EmittedByComponent()
| inline |
Copy constructor (creates empty state).
- Parameters
-
other The component to copy from (state is not copied).
Definition at line 73 of file EmittedByComponent.ixx.
Reference EmittedByComponent.
EmittedByComponent()
| noexcept default |
Definition at line 76 of file EmittedByComponent.ixx.
Reference EmittedByComponent.
Public Operators
operator=()
| default |
Definition at line 75 of file EmittedByComponent.ixx.
Reference EmittedByComponent.
operator=()
| noexcept default |
Definition at line 77 of file EmittedByComponent.ixx.
Reference EmittedByComponent.
Public Member Functions
disable()
| inline noexcept |
Disables this component.
Definition at line 59 of file EmittedByComponent.ixx.
enable()
| inline noexcept |
Enables this component.
Definition at line 52 of file EmittedByComponent.ixx.
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 45 of file EmittedByComponent.ixx.
onAcquire()
| inline noexcept |
onRelease()
| inline noexcept |
reset()
| inline |
Resets the component to its initial state.
Definition at line 100 of file EmittedByComponent.ixx.
setSource()
| inline noexcept |
source()
| inline nodiscard noexcept |
Returns the handle of the source entity.
- Returns
Handle of the entity that emitted this object.
Definition at line 93 of file EmittedByComponent.ixx.
Referenced by setSource.
Private Member Attributes
isEnabled_
|
Whether this component is enabled.
Definition at line 36 of file EmittedByComponent.ixx.
source_
|
Handle of the entity that emitted this object.
Definition at line 31 of file EmittedByComponent.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.