more commands, change display communication to new lib
This commit is contained in:
parent
38463ac109
commit
7213318838
31 changed files with 240 additions and 417 deletions
|
@ -1,3 +1,3 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
internal record struct PixelPosition(int X, int Y);
|
||||
internal record struct PixelPosition(ushort X, ushort Y);
|
|
@ -10,15 +10,15 @@ internal static class PositionHelpers
|
|||
Debug.Assert(subX < 8);
|
||||
Debug.Assert(subY < 8);
|
||||
return new PixelPosition(
|
||||
X: position.X * MapService.TileSize + subX,
|
||||
Y: position.Y * MapService.TileSize + subY
|
||||
X: (ushort)(position.X * MapService.TileSize + subX),
|
||||
Y: (ushort)(position.Y * MapService.TileSize + subY)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public static PixelPosition ToPixelPosition(this FloatPosition position) => new(
|
||||
X: (int)position.X % MapService.PixelsPerRow,
|
||||
Y: (int)position.Y % MapService.PixelsPerRow
|
||||
X: (ushort)((int)position.X % MapService.PixelsPerRow),
|
||||
Y: (ushort)((int)position.Y % MapService.PixelsPerRow)
|
||||
);
|
||||
|
||||
public static TilePosition ToTilePosition(this PixelPosition position) => new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue