implement different kinds of power ups (two bullet types not implemented yet)
This commit is contained in:
parent
a5a3ca3013
commit
21f7d1d5f4
5 changed files with 65 additions and 11 deletions
|
@ -2,7 +2,7 @@ namespace TanksServer.Models;
|
|||
|
||||
internal interface IMapEntity
|
||||
{
|
||||
FloatPosition Position { get; set; }
|
||||
FloatPosition Position { get; }
|
||||
|
||||
PixelBounds Bounds { get; }
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue