improve spawn position checks
This commit is contained in:
parent
91ab911f9c
commit
ad211433fb
16 changed files with 147 additions and 80 deletions
|
@ -1,10 +1,10 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
internal sealed class Bullet(Player tankOwner, FloatPosition position, double rotation)
|
||||
internal sealed class Bullet(Player tankOwner, FloatPosition position, double rotation): IMapEntity
|
||||
{
|
||||
public Player Owner { get; } = tankOwner;
|
||||
|
||||
public FloatPosition Position { get; set; } = position;
|
||||
|
||||
public double Rotation { get; set; } = rotation;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
internal readonly record struct FloatPosition(double X, double Y)
|
||||
{
|
||||
}
|
||||
internal readonly record struct FloatPosition(double X, double Y);
|
||||
|
|
7
TanksServer/Models/IMapEntity.cs
Normal file
7
TanksServer/Models/IMapEntity.cs
Normal file
|
@ -0,0 +1,7 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
internal interface IMapEntity
|
||||
{
|
||||
FloatPosition Position { get; set; }
|
||||
double Rotation { get; set; }
|
||||
}
|
|
@ -2,7 +2,7 @@ using TanksServer.GameLogic;
|
|||
|
||||
namespace TanksServer.Models;
|
||||
|
||||
internal sealed class Tank(Player player, FloatPosition spawnPosition)
|
||||
internal sealed class Tank(Player player, FloatPosition spawnPosition): IMapEntity
|
||||
{
|
||||
private double _rotation;
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
namespace TanksServer.Models;
|
||||
|
||||
public class TanksConfiguration
|
||||
{
|
||||
public double MoveSpeed { get; set; } = 1.4;
|
||||
public double TurnSpeed { get; set; } = 0.4;
|
||||
public double ShootDelayMs { get; set; } = 0.4 * 1000;
|
||||
public double BulletSpeed { get; set; } = 8;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue