separate folders per functionality
This commit is contained in:
parent
7f00160780
commit
0ca6a91a7e
1 changed files with 60 additions and 113 deletions
|
|
@ -1,24 +0,0 @@
|
|||
using TanksServer.Models;
|
||||
using TanksServer.Services;
|
||||
|
||||
namespace TanksServer.TickSteps;
|
||||
|
||||
internal sealed class RotateTanks(TankManager tanks, IOptions<TanksConfiguration> options) : ITickStep
|
||||
{
|
||||
private readonly TanksConfiguration _config = options.Value;
|
||||
|
||||
public Task TickAsync()
|
||||
{
|
||||
foreach (var tank in tanks)
|
||||
{
|
||||
var player = tank.Owner;
|
||||
|
||||
if (player.Controls.TurnLeft)
|
||||
tank.Rotation -= _config.TurnSpeed;
|
||||
if (player.Controls.TurnRight)
|
||||
tank.Rotation += _config.TurnSpeed;
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in a new issue