The INetwork interface defines the essential methods for network communication within the game. It serves as a blueprint for implementing network functionality, allowing for broadcasting messages and running the server.

The INetwork interface is crucial for enabling real-time communication between the server and clients, providing methods for broadcasting data and managing the server lifecycle.

namespace ecs {
    class IContext;

    class INetwork {
      public:
        virtual ~INetwork() = default;
        virtual void broadcast(const IPacket &packet) = 0;
        virtual int run(std::shared_ptr<IContext> &) = 0;

      protected:
      private:
    };
} // namespace ecs

Virtual Methods