diff --git a/Engine.Systems/Network/Extensions/CommunicatorExtensions.cs b/Engine.Systems/Network/Extensions/CommunicatorExtensions.cs new file mode 100644 index 0000000..0d68c56 --- /dev/null +++ b/Engine.Systems/Network/Extensions/CommunicatorExtensions.cs @@ -0,0 +1,13 @@ + +using System.Collections.Generic; + +namespace Engine.Systems.Network; + +public static class CommunicatorExtensions +{ + public static void SendToClients(this INetworkCommunicatorServer server, IEnumerable connections, T packet, PacketDelivery packetDelivery = PacketDelivery.ReliableInOrder) where T : class, new() + { + foreach (IConnection connection in connections) + server.SendToClient(connection, packet, packetDelivery); + } +}