servicepoint-tanks/TanksServer/GameLogic/CollideBulletsWithMap.cs
2024-04-14 21:10:21 +02:00

14 lines
376 B
C#

namespace TanksServer.GameLogic;
internal sealed class CollideBulletsWithMap(BulletManager bullets, MapService map) : ITickStep
{
public Task TickAsync()
{
bullets.RemoveWhere(BulletHitsWall);
return Task.CompletedTask;
}
private bool BulletHitsWall(Bullet bullet) =>
map.Current.IsCurrentlyWall(bullet.Position.ToPixelPosition());
}