R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
server::PlayerJoinedEvent Class Reference

Event triggered when a player joins the game. More...

#include <PlayerJoinedEvent.hpp>

Inheritance diagram for server::PlayerJoinedEvent:
Inheritance graph
Collaboration diagram for server::PlayerJoinedEvent:
Collaboration graph

Public Member Functions

 PlayerJoinedEvent (uint32_t playerId, const std::string &playerName)
 Construct a PlayerJoinedEvent.
 
 ~PlayerJoinedEvent () override=default
 
uint32_t getPlayerId () const
 Get the player ID.
 
const std::string & getPlayerName () const
 Get the player name.
 
- 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 _playerId
 
std::string _playerName
 

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
}
 

Detailed Description

Event triggered when a player joins the game.

Definition at line 19 of file PlayerJoinedEvent.hpp.

Constructor & Destructor Documentation

◆ PlayerJoinedEvent()

server::PlayerJoinedEvent::PlayerJoinedEvent ( uint32_t  playerId,
const std::string &  playerName 
)
inline

Construct a PlayerJoinedEvent.

Parameters
playerIdThe ID of the player who joined
playerNameThe name of the player

Definition at line 26 of file PlayerJoinedEvent.hpp.

◆ ~PlayerJoinedEvent()

server::PlayerJoinedEvent::~PlayerJoinedEvent ( )
overridedefault

Member Function Documentation

◆ getPlayerId()

uint32_t server::PlayerJoinedEvent::getPlayerId ( ) const
inline

Get the player ID.

Definition at line 34 of file PlayerJoinedEvent.hpp.

References _playerId.

◆ getPlayerName()

const std::string & server::PlayerJoinedEvent::getPlayerName ( ) const
inline

Get the player name.

Definition at line 39 of file PlayerJoinedEvent.hpp.

References _playerName.

Member Data Documentation

◆ _playerId

uint32_t server::PlayerJoinedEvent::_playerId
private

Definition at line 42 of file PlayerJoinedEvent.hpp.

Referenced by getPlayerId().

◆ _playerName

std::string server::PlayerJoinedEvent::_playerName
private

Definition at line 43 of file PlayerJoinedEvent.hpp.

Referenced by getPlayerName().


The documentation for this class was generated from the following file: