infinite map

This commit is contained in:
Vinzenz Schroeter 2024-04-12 18:32:10 +02:00
commit 461a9139c2

View file

@ -1,3 +1,9 @@
using TanksServer.GameLogic;
namespace TanksServer.Models;
internal record struct PixelPosition(ushort X, ushort Y);
internal readonly struct PixelPosition(ushort x, ushort y)
{
public ushort X { get; } = (ushort)((x + MapService.PixelsPerRow) % MapService.PixelsPerRow);
public ushort Y { get; } = (ushort)((y + MapService.PixelsPerColumn) % MapService.PixelsPerColumn);
}