servicepoint-tanks/TanksServer/Graphics/DrawBulletsStep.cs

17 lines
493 B
C#
Raw Normal View History

using TanksServer.GameLogic;
namespace TanksServer.Graphics;
2024-04-17 19:34:19 +02:00
internal sealed class DrawBulletsStep(MapEntityManager entityManager) : IDrawStep
{
public void Draw(GamePixelGrid pixels)
{
2024-04-17 19:34:19 +02:00
foreach (var bullet in entityManager.Bullets)
{
var position = bullet.Position.ToPixelPosition();
pixels[position.X, position.Y].EntityType = GamePixelEntityType.Bullet;
pixels[position.X, position.Y].BelongsTo = bullet.Owner;
}
}
}