|
R-Type
Distributed multiplayer game engine in C++
|
Component identifying an entity as a player with game statistics. More...
#include <Player.hpp>


Public Member Functions | |
| Player (int score, int lives, uint32_t playerId) | |
| Constructor with all player data. | |
| ~Player () override=default | |
| int | getScore () const |
| Get player's score. | |
| int | getLives () const |
| Get remaining lives. | |
| int | getPlayerId () const |
| Get player ID. | |
| void | setScore (int score) |
| Set player's score. | |
| void | setLives (int lives) |
| Set remaining lives. | |
| void | setPlayerId (int playerId) |
| Set player ID. | |
| ComponentType | getType () const override |
| Get the component type ID. | |
Public Member Functions inherited from ecs::IComponent | |
| virtual | ~IComponent ()=default |
| Virtual destructor. | |
Private Attributes | |
| int | _score |
| Player's current score. | |
| int | _lives |
| Remaining lives. | |
| int | _playerId |
| Unique player identifier. | |
Component identifying an entity as a player with game statistics.
Stores player-specific data such as score, remaining lives, and player ID for multiplayer identification.
Definition at line 20 of file Player.hpp.
|
inline |
Constructor with all player data.
| score | Initial score |
| lives | Number of lives |
| playerId | Unique player identifier (for multiplayer) |
Definition at line 28 of file Player.hpp.
|
overridedefault |
|
inline |
Get remaining lives.
Definition at line 41 of file Player.hpp.
References _lives.
|
inline |
Get player ID.
Definition at line 47 of file Player.hpp.
References _playerId.
Referenced by Server::_serializeEntity(), and server::GameStateSerializer::serializeEntity().
|
inline |
Get player's score.
Definition at line 35 of file Player.hpp.
References _score.
Referenced by ecs::CollisionSystem::handlePickup().
|
inlineoverridevirtual |
Get the component type ID.
Implements ecs::IComponent.
Definition at line 71 of file Player.hpp.
|
inline |
Set remaining lives.
| lives | New lives count |
Definition at line 59 of file Player.hpp.
References _lives.
|
inline |
Set player ID.
| playerId | New player identifier |
Definition at line 65 of file Player.hpp.
References _playerId.
|
inline |
Set player's score.
| score | New score value |
Definition at line 53 of file Player.hpp.
References _score.
Referenced by ecs::CollisionSystem::handlePickup().
|
private |
Remaining lives.
Definition at line 75 of file Player.hpp.
Referenced by getLives(), and setLives().
|
private |
Unique player identifier.
Definition at line 76 of file Player.hpp.
Referenced by getPlayerId(), and setPlayerId().
|
private |
Player's current score.
Definition at line 74 of file Player.hpp.
Referenced by getScore(), and setScore().