servicepoint-tanks/TanksServer/Models/TilePosition.cs

12 lines
380 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})")]
2024-04-12 18:32:10 +02:00
internal readonly struct TilePosition(ushort x, ushort y)
{
public ushort X { get; } = (ushort)((x + MapService.TilesPerRow) % MapService.TilesPerRow);
public ushort Y { get; } = (ushort)((y + MapService.TilesPerColumn) % MapService.TilesPerColumn);
2024-04-13 16:27:45 +02:00
}