merge options
This commit is contained in:
parent
9cf4304845
commit
043022186f
10 changed files with 28 additions and 40 deletions
|
@ -9,4 +9,16 @@ internal sealed class GameRules
|
|||
public int MaxPowerUpCount { get; set; } = int.MaxValue;
|
||||
|
||||
public int BulletTimeoutMs { get; set; } = int.MaxValue;
|
||||
|
||||
public double MoveSpeed { get; set; }
|
||||
|
||||
public double TurnSpeed { get; set; }
|
||||
|
||||
public double ShootDelayMs { get; set; }
|
||||
|
||||
public double BulletSpeed { get; set; }
|
||||
|
||||
public int SpawnDelayMs { get; set; }
|
||||
|
||||
public int IdleTimeoutMs { get; set; }
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ namespace TanksServer.GameLogic;
|
|||
|
||||
internal sealed class MoveBullets(
|
||||
MapEntityManager entityManager,
|
||||
IOptions<TanksConfiguration> config
|
||||
IOptions<GameRules> config
|
||||
) : ITickStep
|
||||
{
|
||||
public Task TickAsync(TimeSpan delta)
|
||||
|
|
|
@ -2,11 +2,11 @@ namespace TanksServer.GameLogic;
|
|||
|
||||
internal sealed class MoveTanks(
|
||||
MapEntityManager entityManager,
|
||||
IOptions<TanksConfiguration> options,
|
||||
IOptions<GameRules> options,
|
||||
MapService map
|
||||
) : ITickStep
|
||||
{
|
||||
private readonly TanksConfiguration _config = options.Value;
|
||||
private readonly GameRules _config = options.Value;
|
||||
|
||||
public Task TickAsync(TimeSpan delta)
|
||||
{
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
namespace TanksServer.GameLogic;
|
||||
|
||||
public class PlayersConfiguration
|
||||
{
|
||||
public int SpawnDelayMs { get; set; }
|
||||
|
||||
public int IdleTimeoutMs { get; set; }
|
||||
}
|
|
@ -2,11 +2,11 @@ namespace TanksServer.GameLogic;
|
|||
|
||||
internal sealed class RotateTanks(
|
||||
MapEntityManager entityManager,
|
||||
IOptions<TanksConfiguration> options,
|
||||
IOptions<GameRules> options,
|
||||
ILogger<RotateTanks> logger
|
||||
) : ITickStep
|
||||
{
|
||||
private readonly TanksConfiguration _config = options.Value;
|
||||
private readonly GameRules _config = options.Value;
|
||||
|
||||
public Task TickAsync(TimeSpan delta)
|
||||
{
|
||||
|
|
|
@ -3,11 +3,11 @@ using System.Diagnostics;
|
|||
namespace TanksServer.GameLogic;
|
||||
|
||||
internal sealed class ShootFromTanks(
|
||||
IOptions<TanksConfiguration> options,
|
||||
IOptions<GameRules> options,
|
||||
MapEntityManager entityManager
|
||||
) : ITickStep
|
||||
{
|
||||
private readonly TanksConfiguration _config = options.Value;
|
||||
private readonly GameRules _config = options.Value;
|
||||
|
||||
public Task TickAsync(TimeSpan _)
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Diagnostics.CodeAnalysis;
|
|||
namespace TanksServer.GameLogic;
|
||||
|
||||
internal sealed class TankSpawnQueue(
|
||||
IOptions<PlayersConfiguration> options,
|
||||
IOptions<GameRules> options,
|
||||
MapEntityManager entityManager
|
||||
): ITickStep
|
||||
{
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
namespace TanksServer.GameLogic;
|
||||
|
||||
public class TanksConfiguration
|
||||
{
|
||||
public double MoveSpeed { get; set; }
|
||||
public double TurnSpeed { get; set; }
|
||||
public double ShootDelayMs { get; set; }
|
||||
public double BulletSpeed { get; set; }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue