feat: Network Interfaces

This commit is contained in:
Syntriax 2024-02-02 12:20:25 +03:00
parent 0e198afeab
commit d4c57c0153
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,6 @@
namespace Pong.Network;
public interface INetworkClient : INetworkCommunicator
{
void Connect(string address, int port, string? password = null);
}

View File

@ -0,0 +1,14 @@
using System;
using LiteNetLib;
using Syntriax.Engine.Core.Abstract;
namespace Pong.Network;
public interface INetworkCommunicator
{
EventBasedNetListener Listener { get; }
NetManager Manager { get; }
void PollEvents();
void Stop();
}

View File

@ -0,0 +1,10 @@
namespace Pong.Network;
public interface INetworkServer : INetworkCommunicator
{
string Password { get; }
int MaxConnectionCount { get; }
int Port { get; }
void Start(int port, int maxConnectionCount, string? password = null);
}