send scores to big display

This commit is contained in:
Vinzenz Schroeter 2024-04-09 22:38:56 +02:00
parent a89392beb8
commit 7f00160780
22 changed files with 305 additions and 126 deletions

View file

@ -1,11 +1,12 @@
using TanksServer.Helpers;
using TanksServer.ServicePointDisplay;
using TanksServer.Services;
namespace TanksServer.DrawSteps;
internal sealed class BulletDrawer(BulletManager bullets): IDrawStep
{
public void Draw(DisplayPixelBuffer buffer)
public void Draw(PixelDisplayBufferView buffer)
{
foreach (var bullet in bullets.GetAll())
buffer.Pixels[bullet.Position.ToPixelPosition().ToPixelIndex()] = true;

View file

@ -1,8 +1,8 @@
using TanksServer.Helpers;
using TanksServer.ServicePointDisplay;
namespace TanksServer.DrawSteps;
internal interface IDrawStep
{
void Draw(DisplayPixelBuffer buffer);
void Draw(PixelDisplayBufferView buffer);
}

View file

@ -1,12 +1,13 @@
using TanksServer.Helpers;
using TanksServer.Models;
using TanksServer.ServicePointDisplay;
using TanksServer.Services;
namespace TanksServer.DrawSteps;
internal sealed class MapDrawer(MapService map) : IDrawStep
{
public void Draw(DisplayPixelBuffer buffer)
public void Draw(PixelDisplayBufferView buffer)
{
for (var tileY = 0; tileY < MapService.TilesPerColumn; tileY++)
for (var tileX = 0; tileX < MapService.TilesPerRow; tileX++)

View file

@ -1,6 +1,7 @@
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using TanksServer.Helpers;
using TanksServer.ServicePointDisplay;
using TanksServer.Services;
namespace TanksServer.DrawSteps;
@ -29,7 +30,7 @@ internal sealed class TankDrawer : IDrawStep
_tankSpriteWidth = tankImage.Width;
}
public void Draw(DisplayPixelBuffer buffer)
public void Draw(PixelDisplayBufferView buffer)
{
foreach (var tank in _tanks)
{