servicepoint-tanks/TanksServer/Graphics/DrawMapStep.cs

20 lines
500 B
C#
Raw Normal View History

using DisplayCommands;
2024-04-10 19:25:45 +02:00
using TanksServer.GameLogic;
2024-04-10 19:25:45 +02:00
namespace TanksServer.Graphics;
internal sealed class DrawMapStep(MapService map) : IDrawStep
{
public void Draw(PixelGrid buffer)
{
2024-04-14 21:10:21 +02:00
for (ushort y = 0; y < MapService.PixelsPerColumn; y++)
for (ushort x = 0; x < MapService.PixelsPerRow; x++)
{
2024-04-14 21:10:21 +02:00
var pixel = new PixelPosition(x, y);
2024-04-14 22:45:51 +02:00
if (!map.Current.IsWall(pixel))
continue;
2024-04-14 21:10:21 +02:00
buffer[x, y] = true;
}
}
}