|
R-Type
Distributed multiplayer game engine in C++
|
Base class for all network-related events. More...
#include <NetworkEvent.hpp>


Public Types | |
| enum class | Type { UNKNOWN , CLIENT_CONNECTED , CLIENT_DISCONNECTED , MESSAGE_RECEIVED , MESSAGE_SENT } |
Public Member Functions | |
| NetworkEvent (Type type, int clientId=-1) | |
| virtual | ~NetworkEvent () override=default |
| Type | getType () const |
| Get the type of the network event. | |
| int | getClientId () const |
| Get the ID of the client related to this event. | |
Public Member Functions inherited from server::IEvent | |
| IEvent ()=default | |
| virtual | ~IEvent ()=default |
Private Attributes | |
| Type | _type {Type::UNKNOWN} |
| int | _clientId {-1} |
Base class for all network-related events.
Represents events related to client-server communication.
Definition at line 21 of file NetworkEvent.hpp.
|
strong |
| Enumerator | |
|---|---|
| UNKNOWN | |
| CLIENT_CONNECTED | |
| CLIENT_DISCONNECTED | |
| MESSAGE_RECEIVED | |
| MESSAGE_SENT | |
Definition at line 23 of file NetworkEvent.hpp.
|
explicit |
Definition at line 12 of file NetworkEvent.cpp.
|
overridevirtualdefault |
| int NetworkEvent::getClientId | ( | ) | const |
Get the ID of the client related to this event.
Definition at line 18 of file NetworkEvent.cpp.
References _clientId.
| NetworkEvent::Type NetworkEvent::getType | ( | ) | const |
Get the type of the network event.
Definition at line 14 of file NetworkEvent.cpp.
References _type.
|
private |
Definition at line 40 of file NetworkEvent.hpp.
Referenced by getClientId().
|
private |
Definition at line 39 of file NetworkEvent.hpp.
Referenced by getType().