feat: Network Interfaces
This commit is contained in:
		
							
								
								
									
										6
									
								
								Game/Network/INetworkClient.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								Game/Network/INetworkClient.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
namespace Pong.Network;
 | 
			
		||||
 | 
			
		||||
public interface INetworkClient : INetworkCommunicator
 | 
			
		||||
{
 | 
			
		||||
    void Connect(string address, int port, string? password = null);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										14
									
								
								Game/Network/INetworkCommunicator.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								Game/Network/INetworkCommunicator.cs
									
									
									
									
									
										Normal 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();
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								Game/Network/INetworkServer.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								Game/Network/INetworkServer.cs
									
									
									
									
									
										Normal 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);
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user