tanks can spawn and get rendered
This commit is contained in:
parent
151cad4cee
commit
a3bd582b2e
20 changed files with 286 additions and 108 deletions
3
TanksServer/Models/PixelPosition.cs
Normal file
3
TanksServer/Models/PixelPosition.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
internal record struct PixelPosition(int X, int Y);
|
19
TanksServer/Models/Player.cs
Normal file
19
TanksServer/Models/Player.cs
Normal 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; }
|
||||
}
|
8
TanksServer/Models/Tank.cs
Normal file
8
TanksServer/Models/Tank.cs
Normal 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;
|
||||
}
|
3
TanksServer/Models/TilePosition.cs
Normal file
3
TanksServer/Models/TilePosition.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
internal record struct TilePosition(int X, int Y);
|
Loading…
Add table
Add a link
Reference in a new issue