14 lines
385 B
C#
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());
|
|
}
|