servicepoint-tanks/TanksServer/GameLogic/CollideBulletsWithMap.cs
2024-04-10 19:25:45 +02:00

16 lines
401 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)
{
return map.IsCurrentlyWall(bullet.Position.ToPixelPosition().ToTilePosition());
}
}