This repository has been archived on 2026-07-13. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
servicepoint-tanks/TanksServer/TickSteps/SendToServicePointDisplay.cs
Vinzenz Schroeter a9aaf899a2 separate tick steps
2024-04-07 19:52:16 +02:00

21 lines
493 B
C#

using System.Net.Sockets;
namespace TanksServer.TickSteps;
internal sealed class SendToServicePointDisplay(
IOptions<ServicePointDisplayConfiguration> options,
PixelDrawer drawer
) : ITickStep, IDisposable
{
private readonly UdpClient _udpClient = new(options.Value.Hostname, options.Value.Port);
public Task TickAsync()
{
return _udpClient.SendAsync(drawer.LastFrame.Data).AsTask();
}
public void Dispose()
{
_udpClient.Dispose();
}
}