|
R-Type
Distributed multiplayer game engine in C++
|
Event triggered when a new projectile is created in the game. More...
#include <ProjectileCreatedEvent.hpp>


Public Member Functions | |
| ProjectileCreatedEvent (uint32_t projectileId=0, uint32_t ownerId=0, float posX=0.0f, float posY=0.0f, float dirX=0.0f, float dirY=0.0f, float speed=0.0f, int damage=0, bool friendly=true) | |
| Constructor. | |
| ~ProjectileCreatedEvent () override=default | |
| uint32_t | getProjectileId () const |
| Get the projectile entity ID. | |
| uint32_t | getOwnerId () const |
| Get the owner entity ID. | |
| float | getPosX () const |
| Get the starting X position. | |
| float | getPosY () const |
| Get the starting Y position. | |
| float | getDirX () const |
| Get the direction X component. | |
| float | getDirY () const |
| Get the direction Y component. | |
| float | getSpeed () const |
| Get the projectile speed. | |
| int | getDamage () const |
| Get the projectile damage. | |
| bool | isFriendly () const |
| Check if projectile is friendly. | |
Public Member Functions inherited from server::GameEvent | |
| GameEvent (Type type) | |
| virtual | ~GameEvent () override=default |
| Type | getType () const |
| Get the type of the event. | |
Public Member Functions inherited from server::IEvent | |
| IEvent ()=default | |
| virtual | ~IEvent ()=default |
Private Attributes | |
| uint32_t | _projectileId |
| uint32_t | _ownerId |
| float | _posX |
| float | _posY |
| float | _dirX |
| float | _dirY |
| float | _speed |
| int | _damage |
| bool | _friendly |
Additional Inherited Members | |
Public Types inherited from server::GameEvent | |
| enum class | Type { UNKNOWN , PLAYER_JOINED , PLAYER_LEFT , SCORE_UPDATED , GAME_STARTED , GAME_ENDED , PROJECTILE_CREATED } |
Event triggered when a new projectile is created in the game.
Definition at line 19 of file ProjectileCreatedEvent.hpp.
|
inlineexplicit |
Constructor.
| projectileId | Entity ID of the created projectile |
| ownerId | Entity ID of the projectile owner (shooter) |
| posX | Starting X position |
| posY | Starting Y position |
| dirX | Direction X component |
| dirY | Direction Y component |
| speed | Movement speed |
| damage | Damage value |
| friendly | True for player projectile, false for enemy |
Definition at line 33 of file ProjectileCreatedEvent.hpp.
|
overridedefault |
|
inline |
Get the projectile damage.
Definition at line 95 of file ProjectileCreatedEvent.hpp.
References _damage.
|
inline |
Get the direction X component.
Definition at line 77 of file ProjectileCreatedEvent.hpp.
References _dirX.
|
inline |
Get the direction Y component.
Definition at line 83 of file ProjectileCreatedEvent.hpp.
References _dirY.
|
inline |
Get the owner entity ID.
Definition at line 59 of file ProjectileCreatedEvent.hpp.
References _ownerId.
|
inline |
Get the starting X position.
Definition at line 65 of file ProjectileCreatedEvent.hpp.
References _posX.
|
inline |
Get the starting Y position.
Definition at line 71 of file ProjectileCreatedEvent.hpp.
References _posY.
|
inline |
Get the projectile entity ID.
Definition at line 53 of file ProjectileCreatedEvent.hpp.
References _projectileId.
|
inline |
Get the projectile speed.
Definition at line 89 of file ProjectileCreatedEvent.hpp.
References _speed.
|
inline |
Check if projectile is friendly.
Definition at line 101 of file ProjectileCreatedEvent.hpp.
References _friendly.
|
private |
Definition at line 111 of file ProjectileCreatedEvent.hpp.
Referenced by getDamage().
|
private |
Definition at line 108 of file ProjectileCreatedEvent.hpp.
Referenced by getDirX().
|
private |
Definition at line 109 of file ProjectileCreatedEvent.hpp.
Referenced by getDirY().
|
private |
Definition at line 112 of file ProjectileCreatedEvent.hpp.
Referenced by isFriendly().
|
private |
Definition at line 105 of file ProjectileCreatedEvent.hpp.
Referenced by getOwnerId().
|
private |
Definition at line 106 of file ProjectileCreatedEvent.hpp.
Referenced by getPosX().
|
private |
Definition at line 107 of file ProjectileCreatedEvent.hpp.
Referenced by getPosY().
|
private |
Definition at line 104 of file ProjectileCreatedEvent.hpp.
Referenced by getProjectileId().
|
private |
Definition at line 110 of file ProjectileCreatedEvent.hpp.
Referenced by getSpeed().