refactor: network entity packets

This commit is contained in:
2025-05-17 22:17:25 +03:00
parent 03082ab43b
commit 721d63cf66
8 changed files with 207 additions and 33 deletions

View File

@@ -0,0 +1,6 @@
namespace Syntriax.Engine.Network;
public interface IEntityNetworkPacket : INetworkPacket
{
string EntityId { get; }
}

View File

@@ -6,8 +6,8 @@ public interface INetworkCommunicator
{
INetworkCommunicator Stop();
void SubscribeToPackets<T>(Action<T> callback);
void UnsubscribeFromPackets<T>(Action<T> callback);
INetworkCommunicator SubscribeToPackets<T>(Action<T, string> callback);
INetworkCommunicator UnsubscribeFromPackets<T>(Action<T, string> callback);
}
public interface INetworkCommunicatorClient : INetworkCommunicator

View File

@@ -4,5 +4,5 @@ namespace Syntriax.Engine.Network;
public interface INetworkEntity : IEntity
{
void ReceiveData(object data);
void ReceiveDataClient<T>(T data);
}

View File

@@ -6,8 +6,6 @@ namespace Syntriax.Engine.Network;
public interface INetworkManager
{
INetworkCommunicator NetworkCommunicator { get; }
IReadOnlyDictionary<string, INetworkEntity> NetworkEntities { get; }
IBehaviourCollector<INetworkEntity> NetworkEntityCollector { get; }
}