implement different kinds of power ups (two bullet types not implemented yet)

This commit is contained in:
Vinzenz Schroeter 2024-04-29 18:03:23 +02:00
parent a5a3ca3013
commit 21f7d1d5f4
5 changed files with 65 additions and 11 deletions

View file

@ -2,7 +2,7 @@ namespace TanksServer.Models;
internal interface IMapEntity
{
FloatPosition Position { get; set; }
FloatPosition Position { get; }
PixelBounds Bounds { get; }
}

View file

@ -2,9 +2,19 @@ using TanksServer.GameLogic;
namespace TanksServer.Models;
internal sealed class PowerUp(FloatPosition position): IMapEntity
internal enum PowerUpType
{
public FloatPosition Position { get; set; } = position;
MagazineTypeUpgrade,
MagazineSizeUpgrade
}
internal sealed class PowerUp: IMapEntity
{
public required FloatPosition Position { get; init; }
public PixelBounds Bounds => Position.GetBoundsForCenter(MapService.TileSize);
public required PowerUpType Type { get; init; }
public MagazineType? MagazineType { get; init; }
}