separate folders per functionality

This commit is contained in:
Vinzenz Schroeter 2024-04-10 19:25:45 +02:00
commit 0ca6a91a7e
33 changed files with 60 additions and 113 deletions

View file

@ -1,6 +1,4 @@
using TanksServer.Models;
namespace TanksServer.Services;
namespace TanksServer.GameLogic;
internal sealed class BulletManager
{

View file

@ -1,8 +1,4 @@
using TanksServer.Helpers;
using TanksServer.Models;
using TanksServer.Services;
namespace TanksServer.TickSteps;
namespace TanksServer.GameLogic;
internal sealed class CollideBulletsWithMap(BulletManager bullets, MapService map) : ITickStep
{

View file

@ -1,7 +1,4 @@
using TanksServer.Models;
using TanksServer.Services;
namespace TanksServer.TickSteps;
namespace TanksServer.GameLogic;
internal sealed class CollideBulletsWithTanks(
BulletManager bullets, TankManager tanks, SpawnQueueProvider spawnQueueProvider

View file

@ -1,9 +1,7 @@
using System.Diagnostics;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using TanksServer.TickSteps;
namespace TanksServer.Services;
namespace TanksServer.GameLogic;
internal sealed class GameTickWorker(
IEnumerable<ITickStep> steps,

View file

@ -1,4 +1,4 @@
namespace TanksServer.TickSteps;
namespace TanksServer.GameLogic;
public interface ITickStep
{

View file

@ -1,6 +1,4 @@
using TanksServer.Models;
namespace TanksServer.Services;
namespace TanksServer.GameLogic;
internal sealed class MapService
{

View file

@ -1,7 +1,4 @@
using TanksServer.Models;
using TanksServer.Services;
namespace TanksServer.TickSteps;
namespace TanksServer.GameLogic;
internal sealed class MoveBullets(BulletManager bullets) : ITickStep
{

View file

@ -1,10 +1,9 @@
using TanksServer.Models;
using TanksServer.Services;
namespace TanksServer.TickSteps;
namespace TanksServer.GameLogic;
internal sealed class MoveTanks(
TankManager tanks, IOptions<TanksConfiguration> options, MapService map
TankManager tanks,
IOptions<TanksConfiguration> options,
MapService map
) : ITickStep
{
private readonly TanksConfiguration _config = options.Value;

View file

@ -1,7 +1,4 @@
using TanksServer.Models;
using TanksServer.Services;
namespace TanksServer.TickSteps;
namespace TanksServer.GameLogic;
internal sealed class RotateTanks(TankManager tanks, IOptions<TanksConfiguration> options) : ITickStep
{

View file

@ -1,7 +1,4 @@
using TanksServer.Models;
using TanksServer.Services;
namespace TanksServer.TickSteps;
namespace TanksServer.GameLogic;
internal sealed class ShootFromTanks(
TankManager tanks,

View file

@ -1,7 +1,4 @@
using TanksServer.Models;
using TanksServer.Services;
namespace TanksServer.TickSteps;
namespace TanksServer.GameLogic;
internal sealed class SpawnNewTanks(TankManager tanks, MapService map, SpawnQueueProvider queueProvider) : ITickStep
{

View file

@ -1,6 +1,4 @@
using TanksServer.Models;
namespace TanksServer.Services;
namespace TanksServer.GameLogic;
internal sealed class SpawnQueueProvider
{

View file

@ -1,8 +1,6 @@
using System.Collections;
using Microsoft.Extensions.Logging;
using TanksServer.Models;
namespace TanksServer.Services;
namespace TanksServer.GameLogic;
internal sealed class TankManager(ILogger<TankManager> logger) : IEnumerable<Tank>
{

View file

@ -4,4 +4,6 @@ global using System.Collections.Generic;
global using System.Linq;
global using System.Threading;
global using System.Threading.Tasks;
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Options;
global using TanksServer.Models;

View file

@ -1,8 +1,7 @@
using TanksServer.Helpers;
using TanksServer.GameLogic;
using TanksServer.ServicePointDisplay;
using TanksServer.Services;
namespace TanksServer.DrawSteps;
namespace TanksServer.Graphics;
internal sealed class BulletDrawer(BulletManager bullets): IDrawStep
{

View file

@ -1,8 +1,7 @@
using TanksServer.DrawSteps;
using TanksServer.GameLogic;
using TanksServer.ServicePointDisplay;
using TanksServer.Services;
namespace TanksServer.TickSteps;
namespace TanksServer.Graphics;
internal sealed class DrawStateToFrame(
IEnumerable<IDrawStep> drawSteps, LastFinishedFrameProvider lastFrameProvider

View file

@ -1,6 +1,6 @@
using TanksServer.ServicePointDisplay;
namespace TanksServer.DrawSteps;
namespace TanksServer.Graphics;
internal interface IDrawStep
{

View file

@ -1,6 +1,6 @@
using TanksServer.ServicePointDisplay;
namespace TanksServer.Services;
namespace TanksServer.Graphics;
internal sealed class LastFinishedFrameProvider
{

View file

@ -1,9 +1,7 @@
using TanksServer.Helpers;
using TanksServer.Models;
using TanksServer.GameLogic;
using TanksServer.ServicePointDisplay;
using TanksServer.Services;
namespace TanksServer.DrawSteps;
namespace TanksServer.Graphics;
internal sealed class MapDrawer(MapService map) : IDrawStep
{

View file

@ -1,10 +1,9 @@
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using TanksServer.Helpers;
using TanksServer.GameLogic;
using TanksServer.ServicePointDisplay;
using TanksServer.Services;
namespace TanksServer.DrawSteps;
namespace TanksServer.Graphics;
internal sealed class TankDrawer : IDrawStep
{

Some files were not shown because too many files have changed in this diff Show more