servicepoint-tanks/TanksServer/GameLogic/BulletManager.cs

14 lines
424 B
C#
Raw Normal View History

2024-04-10 19:25:45 +02:00
namespace TanksServer.GameLogic;
2024-04-07 19:52:16 +02:00
internal sealed class BulletManager
{
2024-04-13 14:08:51 +02:00
private readonly HashSet<Bullet> _bullets = [];
2024-04-16 20:24:29 +02:00
public void Spawn(Player tankOwner, FloatPosition position, double rotation)
=> _bullets.Add(new Bullet(tankOwner, position, rotation));
2024-04-07 19:19:11 +02:00
public IEnumerable<Bullet> GetAll() => _bullets;
2024-04-13 14:08:51 +02:00
public void RemoveWhere(Predicate<Bullet> predicate) => _bullets.RemoveWhere(predicate);
}