servicepoint-tanks/tanks-backend/TanksServer/Models/PixelPosition.cs

18 lines
458 B
C#
Raw Permalink Normal View History

2024-04-13 16:27:45 +02:00
using System.Diagnostics;
2024-04-12 18:32:10 +02:00
using TanksServer.GameLogic;
2024-04-07 13:02:49 +02:00
namespace TanksServer.Models;
2024-04-13 16:27:45 +02:00
[DebuggerDisplay("({X} | {Y})")]
internal readonly struct PixelPosition(ulong x, ulong y)
2024-04-12 18:32:10 +02:00
{
public ulong X { get; } = (x + MapService.PixelsPerRow) % MapService.PixelsPerRow;
public ulong Y { get; } = (y + MapService.PixelsPerColumn) % MapService.PixelsPerColumn;
2024-04-13 16:27:45 +02:00
public void Deconstruct(out ulong x, out ulong y)
2024-04-13 16:27:45 +02:00
{
x = X;
y = Y;
}
}