2024-04-12 16:05:24 +02:00
|
|
|
using DisplayCommands;
|
2024-04-10 19:25:45 +02:00
|
|
|
using TanksServer.GameLogic;
|
2024-04-07 19:05:50 +02:00
|
|
|
|
2024-04-10 19:25:45 +02:00
|
|
|
namespace TanksServer.Graphics;
|
2024-04-07 19:05:50 +02:00
|
|
|
|
2024-04-12 16:05:24 +02:00
|
|
|
internal sealed class BulletDrawer(BulletManager bullets) : IDrawStep
|
2024-04-07 19:05:50 +02:00
|
|
|
{
|
2024-04-12 16:05:24 +02:00
|
|
|
public void Draw(PixelGrid buffer)
|
2024-04-07 19:05:50 +02:00
|
|
|
{
|
|
|
|
foreach (var bullet in bullets.GetAll())
|
2024-04-12 16:05:24 +02:00
|
|
|
{
|
|
|
|
var pos = bullet.Position.ToPixelPosition();
|
|
|
|
buffer[pos.X, pos.Y] = true;
|
|
|
|
}
|
2024-04-07 19:05:50 +02:00
|
|
|
}
|
2024-04-12 16:05:24 +02:00
|
|
|
}
|