30 Projectile(
float damage,
float lifetime, std::uint32_t ownerId,
bool friendly)
Base interface for all ECS components.
Component for projectile entities (bullets, missiles, etc.).
void setLifetime(float lifetime)
Set remaining lifetime.
bool isFriendly() const
Check if projectile is friendly.
float _lifetime
Remaining lifetime in seconds.
void setDamage(float damage)
Set damage value.
void setFriendly(bool friendly)
Set friendly status.
float _damage
Damage dealt on impact.
std::uint32_t getOwnerId() const
Get owner entity ID.
std::uint32_t _ownerId
Entity ID of the shooter.
float getLifetime() const
Get remaining lifetime.
ComponentType getType() const override
Get the component type ID.
Projectile(float damage, float lifetime, std::uint32_t ownerId, bool friendly)
Constructor with projectile parameters.
void setOwnerId(std::uint32_t ownerId)
Set owner entity ID.
float getDamage() const
Get damage value.
bool _friendly
Team affiliation (true=friendly, false=enemy)
~Projectile() override=default
Maximum number of distinct component types supported by the Registry.
std::size_t ComponentType
Type alias for component identification.