tanks can spawn and get rendered

This commit is contained in:
Vinzenz Schroeter 2024-04-07 13:02:49 +02:00
commit a3bd582b2e

View file

@ -2,7 +2,7 @@ using Microsoft.Extensions.Hosting;
namespace TanksServer.Services;
internal sealed class GameTickService(IEnumerable<ITickStep> steps) : IHostedService
internal sealed class GameTickService(IEnumerable<ITickStep> steps) : IHostedService, IDisposable
{
private readonly CancellationTokenSource _cancellation = new();
private readonly List<ITickStep> _steps = steps.ToList();
@ -29,6 +29,12 @@ internal sealed class GameTickService(IEnumerable<ITickStep> steps) : IHostedSer
await _cancellation.CancelAsync();
if (_run != null) await _run;
}
public void Dispose()
{
_cancellation.Dispose();
_run?.Dispose();
}
}
public interface ITickStep