servicepoint-tanks/TanksServer/GameLogic/CollideBulletsWithMap.cs
Vinzenz Schroeter 1f0e6ba8fa formatting
2024-04-13 14:08:51 +02:00

14 lines
385 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.IsCurrentlyWall(bullet.Position.ToPixelPosition().ToTilePosition());
}