Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
INetwork.hpp
Go to the documentation of this file.
1
8#ifndef RTYPE_NETWORK_INETWORK_HPP_
9 #define RTYPE_NETWORK_INETWORK_HPP_
10
11 #include <optional>
13
18namespace rtp::net {
19
25 enum class NetworkMode {
26 TCP,
27 UDP
28 };
29
34 struct NetworkEvent {
35 uint32_t sessionId;
37 };
38
46 class INetwork {
47 public:
51 virtual ~INetwork() = default;
52
57 virtual void start(void) = 0;
58
62 virtual void stop(void) = 0;
63
69 virtual std::optional<NetworkEvent> pollEvent(void) = 0;
70 };
71}
72
73#endif /* !RTYPE_NETWORK_INETWORK_HPP_ */
Network packet implementation for R-Type protocol.
Interface for network operations.
Definition INetwork.hpp:46
virtual ~INetwork()=default
Virtual destructor.
virtual void start(void)=0
Start the network on the specified port.
virtual void stop(void)=0
Stop the network.
virtual std::optional< NetworkEvent > pollEvent(void)=0
Poll for a network event.
Network packet with header and serializable body.
Definition Packet.hpp:471
File : IEventPublisher.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue....
NetworkMode
Enum representing network transmission modes.
Definition INetwork.hpp:25
Represents a network event containing session ID and packet data.
Definition INetwork.hpp:34