powerup fixes
This commit is contained in:
parent
b47901313b
commit
a0b25b9cfb
7 changed files with 26 additions and 34 deletions
|
@ -4,13 +4,13 @@ using TanksServer.GameLogic;
|
|||
|
||||
namespace TanksServer.Models;
|
||||
|
||||
internal sealed class Tank(Player owner) : IMapEntity
|
||||
internal sealed class Tank(Player owner, FloatPosition position) : IMapEntity
|
||||
{
|
||||
private double _rotation;
|
||||
|
||||
[JsonIgnore] public Player Owner { get; } = owner;
|
||||
|
||||
public double Rotation
|
||||
[JsonIgnore] public double Rotation
|
||||
{
|
||||
get => _rotation;
|
||||
set
|
||||
|
@ -25,7 +25,9 @@ internal sealed class Tank(Player owner) : IMapEntity
|
|||
|
||||
public bool Moving { get; set; }
|
||||
|
||||
public required FloatPosition Position { get; set; }
|
||||
[JsonIgnore] public FloatPosition Position { get; set; } = position;
|
||||
|
||||
public PixelPosition PixelPosition => Position.ToPixelPosition();
|
||||
|
||||
[JsonIgnore] public PixelBounds Bounds => Position.GetBoundsForCenter(MapService.TileSize);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue