tanks can spawn and get rendered

This commit is contained in:
Vinzenz Schroeter 2024-04-07 13:02:49 +02:00
parent 151cad4cee
commit a3bd582b2e
20 changed files with 286 additions and 108 deletions

View file

@ -0,0 +1,3 @@
namespace TanksServer.Models;
internal record struct PixelPosition(int X, int Y);

View file

@ -0,0 +1,19 @@
namespace TanksServer.Models;
internal sealed class Player(string name)
{
public string Name => name;
public Guid Id { get; } = Guid.NewGuid();
public PlayerControls Controls { get; } = new();
}
internal sealed class PlayerControls
{
public bool Forward { get; set; }
public bool Backward { get; set; }
public bool TurnLeft { get; set; }
public bool TurnRight { get; set; }
public bool Shoot { get; set; }
}

View file

@ -0,0 +1,8 @@
namespace TanksServer.Models;
internal sealed class Tank(Player player, PixelPosition spawnPosition)
{
public Player Owner { get; } = player;
public int Rotation { get; set; }
public PixelPosition Position { get; set; } = spawnPosition;
}

View file

@ -0,0 +1,3 @@
namespace TanksServer.Models;
internal record struct TilePosition(int X, int Y);