servicepoint-tanks/TanksServer/Graphics/DrawBulletsStep.cs
2024-04-15 20:34:23 +02:00

17 lines
479 B
C#

using TanksServer.GameLogic;
namespace TanksServer.Graphics;
internal sealed class DrawBulletsStep(BulletManager bullets) : IDrawStep
{
public void Draw(GamePixelGrid pixels)
{
foreach (var bullet in bullets.GetAll())
{
var position = bullet.Position.ToPixelPosition();
pixels[position.X, position.Y].EntityType = GamePixelEntityType.Bullet;
pixels[position.X, position.Y].BelongsTo = bullet.Owner;
}
}
}