servicepoint-tanks/TanksServer/Models/PixelPosition.cs

18 lines
446 B
C#
Raw 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(int x, int y)
2024-04-12 18:32:10 +02:00
{
2024-04-13 16:27:45 +02:00
public int X { get; } = (x + MapService.PixelsPerRow) % MapService.PixelsPerRow;
public int Y { get; } = (y + MapService.PixelsPerColumn) % MapService.PixelsPerColumn;
public void Deconstruct(out int x, out int y)
{
x = X;
y = Y;
}
}