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

Event triggered when the game ends. More...

#include <GameEndedEvent.hpp>

Inheritance diagram for server::GameEndedEvent:
Inheritance graph
Collaboration diagram for server::GameEndedEvent:
Collaboration graph

Public Member Functions

 GameEndedEvent (const std::string &reason="")
 Construct a GameEndedEvent.
 
 ~GameEndedEvent () override=default
 
const std::string & getReason () const
 Get the reason for game ending.
 
- 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

std::string _reason
 

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 the game ends.

Definition at line 18 of file GameEndedEvent.hpp.

Constructor & Destructor Documentation

◆ GameEndedEvent()

server::GameEndedEvent::GameEndedEvent ( const std::string &  reason = "")
inlineexplicit

Construct a GameEndedEvent.

Parameters
reasonReason for game ending (e.g., "Victory", "Defeat", "Timeout")

Definition at line 24 of file GameEndedEvent.hpp.

◆ ~GameEndedEvent()

server::GameEndedEvent::~GameEndedEvent ( )
overridedefault

Member Function Documentation

◆ getReason()

const std::string & server::GameEndedEvent::getReason ( ) const
inline

Get the reason for game ending.

Definition at line 32 of file GameEndedEvent.hpp.

References _reason.

Member Data Documentation

◆ _reason

std::string server::GameEndedEvent::_reason
private

Definition at line 35 of file GameEndedEvent.hpp.

Referenced by getReason().


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