This repository has been archived on 2026-07-13. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
servicepoint-tanks/TanksServer/GameLogic/CollideBulletsWithMap.cs
Vinzenz Schroeter 1f0e6ba8fa formatting
2024-04-13 14:08:51 +02:00

13 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());
}