R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
PlayerJoinedEvent.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** Created by hugo on 12/12/2025
4** File description:
5** PlayerJoinedEvent.hpp
6*/
7
8#pragma once
9
10#include <string>
12
13namespace server {
14
20 public:
26 PlayerJoinedEvent(uint32_t playerId, const std::string &playerName)
27 : GameEvent(Type::PLAYER_JOINED), _playerId(playerId), _playerName(playerName) {}
28
29 ~PlayerJoinedEvent() override = default;
30
34 uint32_t getPlayerId() const { return _playerId; }
35
39 const std::string &getPlayerName() const { return _playerName; }
40
41 private:
42 uint32_t _playerId;
43 std::string _playerName;
44 };
45
46} // namespace server
Base class for all game-related events.
Definition GameEvent.hpp:19
Event triggered when a player joins the game.
PlayerJoinedEvent(uint32_t playerId, const std::string &playerName)
Construct a PlayerJoinedEvent.
~PlayerJoinedEvent() override=default
const std::string & getPlayerName() const
Get the player name.
uint32_t getPlayerId() const
Get the player ID.