|
R-Type
Distributed multiplayer game engine in C++
|
Component for projectile entities (bullets, missiles, etc.). More...
#include <Projectile.hpp>


Public Member Functions | |
| Projectile (float damage, float lifetime, std::uint32_t ownerId, bool friendly) | |
| Constructor with projectile parameters. | |
| ~Projectile () override=default | |
| float | getDamage () const |
| Get damage value. | |
| float | getLifetime () const |
| Get remaining lifetime. | |
| std::uint32_t | getOwnerId () const |
| Get owner entity ID. | |
| bool | isFriendly () const |
| Check if projectile is friendly. | |
| void | setDamage (float damage) |
| Set damage value. | |
| void | setLifetime (float lifetime) |
| Set remaining lifetime. | |
| void | setOwnerId (std::uint32_t ownerId) |
| Set owner entity ID. | |
| void | setFriendly (bool friendly) |
| Set friendly status. | |
| ComponentType | getType () const override |
| Get the component type ID. | |
Public Member Functions inherited from ecs::IComponent | |
| virtual | ~IComponent ()=default |
| Virtual destructor. | |
Private Attributes | |
| float | _damage |
| Damage dealt on impact. | |
| float | _lifetime |
| Remaining lifetime in seconds. | |
| std::uint32_t | _ownerId |
| Entity ID of the shooter. | |
| bool | _friendly |
| Team affiliation (true=friendly, false=enemy) | |
Component for projectile entities (bullets, missiles, etc.).
Stores projectile-specific data including damage, lifetime duration, owner identification, and team affiliation (friendly/enemy).
Definition at line 21 of file Projectile.hpp.
|
inline |
Constructor with projectile parameters.
| damage | Damage dealt on impact |
| lifetime | Duration before auto-destruction (in seconds) |
| ownerId | Entity ID of the shooter |
| friendly | True if friendly projectile, false if enemy |
Definition at line 30 of file Projectile.hpp.
|
overridedefault |
|
inline |
Get damage value.
Definition at line 38 of file Projectile.hpp.
References _damage.
Referenced by ecs::CollisionSystem::handleProjectileCollision().
|
inline |
Get remaining lifetime.
Definition at line 44 of file Projectile.hpp.
References _lifetime.
|
inline |
Get owner entity ID.
Definition at line 50 of file Projectile.hpp.
References _ownerId.
|
inlineoverridevirtual |
Get the component type ID.
Implements ecs::IComponent.
Definition at line 86 of file Projectile.hpp.
|
inline |
Check if projectile is friendly.
Definition at line 56 of file Projectile.hpp.
References _friendly.
Referenced by Server::_serializeEntity(), ecs::CollisionSystem::handleModuleProjectileCollision(), and ecs::CollisionSystem::handleProjectileCollision().
|
inline |
Set damage value.
| damage | New damage value |
Definition at line 62 of file Projectile.hpp.
References _damage.
|
inline |
Set friendly status.
| friendly | True for friendly, false for enemy |
Definition at line 80 of file Projectile.hpp.
References _friendly.
|
inline |
Set remaining lifetime.
| lifetime | New lifetime value in seconds |
Definition at line 68 of file Projectile.hpp.
References _lifetime.
|
inline |
Set owner entity ID.
| ownerId | New owner ID |
Definition at line 74 of file Projectile.hpp.
References _ownerId.
|
private |
Damage dealt on impact.
Definition at line 89 of file Projectile.hpp.
Referenced by getDamage(), and setDamage().
|
private |
Team affiliation (true=friendly, false=enemy)
Definition at line 92 of file Projectile.hpp.
Referenced by isFriendly(), and setFriendly().
|
private |
Remaining lifetime in seconds.
Definition at line 90 of file Projectile.hpp.
Referenced by getLifetime(), and setLifetime().
|
private |
Entity ID of the shooter.
Definition at line 91 of file Projectile.hpp.
Referenced by getOwnerId(), and setOwnerId().