From 8d09663eff8f0d65829c4615a683a8b61c082fd8 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 21 Apr 2024 12:38:03 +0200 Subject: [PATCH] move backend to subfolder --- TanksServer/TanksServer.csproj | 48 ------------------ .../DisplayCommands}/ByteGrid.cs | 0 .../DisplayCommands}/Cp437Grid.cs | 0 .../DisplayCommands}/DisplayCommands.csproj | 14 ++--- .../DisplayCommands}/DisplayConfiguration.cs | 0 .../DisplayCommands}/DisplayExtensions.cs | 0 .../DisplayCommands}/GlobalUsings.cs | 0 .../DisplayCommands}/IDisplayConnection.cs | 0 .../Internals/DisplayCommand.cs | 0 .../Internals/DisplayConnection.cs | 0 .../Internals/DisplaySubCommand.cs | 0 .../Internals/HeaderBitmap.cs | 0 .../Internals/HeaderWindow.cs | 0 .../DisplayCommands}/PixelGrid.cs | 0 .../EndiannessGenerator.cs | 47 ++++++++--------- .../EndiannessSourceGenerator.csproj | 4 +- .../Properties/launchSettings.json | 9 ++++ .../EndiannessSourceGenerator}/Readme.md | 0 .../TanksServer.sln | 6 +++ .../TanksServer}/Endpoints.cs | 1 - .../TanksServer}/GameLogic/CollectPowerUp.cs | 0 .../TanksServer}/GameLogic/CollideBullets.cs | 0 .../TanksServer}/GameLogic/GameRules.cs | 0 .../TanksServer}/GameLogic/GameTickWorker.cs | 0 .../TanksServer}/GameLogic/ITickStep.cs | 0 .../GameLogic/MapEntityManager.cs | 0 .../TanksServer}/GameLogic/MapService.cs | 0 .../TanksServer}/GameLogic/MoveBullets.cs | 0 .../TanksServer}/GameLogic/MoveTanks.cs | 0 .../TanksServer}/GameLogic/RotateTanks.cs | 0 .../TanksServer}/GameLogic/ShootFromTanks.cs | 0 .../TanksServer}/GameLogic/SpawnPowerUp.cs | 0 .../TanksServer}/GameLogic/TankSpawnQueue.cs | 2 +- .../TanksServer}/GlobalUsings.cs | 0 .../TanksServer}/Graphics/DrawBulletsStep.cs | 0 .../TanksServer}/Graphics/DrawMapStep.cs | 0 .../TanksServer}/Graphics/DrawPowerUpsStep.cs | 0 .../TanksServer}/Graphics/DrawTanksStep.cs | 0 .../TanksServer}/Graphics/GamePixel.cs | 0 .../Graphics/GamePixelEntityType.cs | 0 .../TanksServer}/Graphics/GamePixelGrid.cs | 0 .../Graphics/GeneratePixelsTickStep.cs | 0 .../TanksServer}/Graphics/IDrawStep.cs | 0 .../TanksServer}/Graphics/IFrameConsumer.cs | 0 .../Interactivity/AppSerializerContext.cs | 0 .../Interactivity/ByteChannelWebSocket.cs | 0 .../Interactivity/ClientScreenServer.cs | 0 .../ClientScreenServerConnection.cs | 0 .../Interactivity/ControlsServer.cs | 0 .../Interactivity/PlayerScreenData.cs | 0 .../Interactivity/PlayerServer.cs | 0 .../SendToServicePointDisplay.cs | 0 .../TanksServer}/Models/Bullet.cs | 0 .../TanksServer}/Models/FloatPosition.cs | 0 .../TanksServer}/Models/HostConfiguration.cs | 0 .../TanksServer}/Models/IMapEntity.cs | 0 .../TanksServer}/Models/PixelBounds.cs | 0 .../TanksServer}/Models/PixelPosition.cs | 0 .../TanksServer}/Models/Player.cs | 0 .../TanksServer}/Models/PlayerControls.cs | 0 .../TanksServer}/Models/PositionHelpers.cs | 0 .../TanksServer}/Models/PowerUp.cs | 0 .../TanksServer}/Models/Scores.cs | 0 .../TanksServer}/Models/Tank.cs | 0 .../TanksServer}/Models/TilePosition.cs | 0 .../TanksServer}/Program.cs | 4 +- .../Properties/launchSettings.json | 0 tanks-backend/TanksServer/TanksServer.csproj | 26 ++++++++++ .../TanksServer}/appsettings.json | 0 .../TanksServer}/assets/maps/buggie.txt | 0 .../TanksServer/assets/maps/chaosknoten.png | Bin 0 -> 2299 bytes .../TanksServer}/assets/maps/orig.txt | 0 .../TanksServer}/assets/maps/tanks.txt | 0 .../TanksServer}/assets/maps/test2.png | Bin .../TanksServer}/assets/maps/upside_down.txt | 0 .../TanksServer}/assets/powerup_explosive.png | Bin .../TanksServer}/assets/tank.png | Bin .../TanksServer}/userRequests.http | 5 +- global.json => tanks-backend/global.json | 0 tanks-backend/shared.props | 20 ++++++++ 80 files changed, 98 insertions(+), 88 deletions(-) delete mode 100644 TanksServer/TanksServer.csproj rename {DisplayCommands => tanks-backend/DisplayCommands}/ByteGrid.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/Cp437Grid.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/DisplayCommands.csproj (73%) rename {DisplayCommands => tanks-backend/DisplayCommands}/DisplayConfiguration.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/DisplayExtensions.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/GlobalUsings.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/IDisplayConnection.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/Internals/DisplayCommand.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/Internals/DisplayConnection.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/Internals/DisplaySubCommand.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/Internals/HeaderBitmap.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/Internals/HeaderWindow.cs (100%) rename {DisplayCommands => tanks-backend/DisplayCommands}/PixelGrid.cs (100%) rename {EndiannessSourceGenerator => tanks-backend/EndiannessSourceGenerator}/EndiannessGenerator.cs (87%) rename {EndiannessSourceGenerator => tanks-backend/EndiannessSourceGenerator}/EndiannessSourceGenerator.csproj (90%) create mode 100644 tanks-backend/EndiannessSourceGenerator/Properties/launchSettings.json rename {EndiannessSourceGenerator => tanks-backend/EndiannessSourceGenerator}/Readme.md (100%) rename TanksServer.sln => tanks-backend/TanksServer.sln (88%) rename {TanksServer => tanks-backend/TanksServer}/Endpoints.cs (99%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/CollectPowerUp.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/CollideBullets.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/GameRules.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/GameTickWorker.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/ITickStep.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/MapEntityManager.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/MapService.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/MoveBullets.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/MoveTanks.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/RotateTanks.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/ShootFromTanks.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/SpawnPowerUp.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/GameLogic/TankSpawnQueue.cs (95%) rename {TanksServer => tanks-backend/TanksServer}/GlobalUsings.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Graphics/DrawBulletsStep.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Graphics/DrawMapStep.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Graphics/DrawPowerUpsStep.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Graphics/DrawTanksStep.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Graphics/GamePixel.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Graphics/GamePixelEntityType.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Graphics/GamePixelGrid.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Graphics/GeneratePixelsTickStep.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Graphics/IDrawStep.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Graphics/IFrameConsumer.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Interactivity/AppSerializerContext.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Interactivity/ByteChannelWebSocket.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Interactivity/ClientScreenServer.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Interactivity/ClientScreenServerConnection.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Interactivity/ControlsServer.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Interactivity/PlayerScreenData.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Interactivity/PlayerServer.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Interactivity/SendToServicePointDisplay.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/Bullet.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/FloatPosition.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/HostConfiguration.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/IMapEntity.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/PixelBounds.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/PixelPosition.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/Player.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/PlayerControls.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/PositionHelpers.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/PowerUp.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/Scores.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/Tank.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Models/TilePosition.cs (100%) rename {TanksServer => tanks-backend/TanksServer}/Program.cs (98%) rename {TanksServer => tanks-backend/TanksServer}/Properties/launchSettings.json (100%) create mode 100644 tanks-backend/TanksServer/TanksServer.csproj rename {TanksServer => tanks-backend/TanksServer}/appsettings.json (100%) rename {TanksServer => tanks-backend/TanksServer}/assets/maps/buggie.txt (100%) create mode 100644 tanks-backend/TanksServer/assets/maps/chaosknoten.png rename {TanksServer => tanks-backend/TanksServer}/assets/maps/orig.txt (100%) rename {TanksServer => tanks-backend/TanksServer}/assets/maps/tanks.txt (100%) rename {TanksServer => tanks-backend/TanksServer}/assets/maps/test2.png (100%) rename {TanksServer => tanks-backend/TanksServer}/assets/maps/upside_down.txt (100%) rename {TanksServer => tanks-backend/TanksServer}/assets/powerup_explosive.png (100%) rename {TanksServer => tanks-backend/TanksServer}/assets/tank.png (100%) rename {TanksServer => tanks-backend/TanksServer}/userRequests.http (62%) rename global.json => tanks-backend/global.json (100%) create mode 100644 tanks-backend/shared.props diff --git a/TanksServer/TanksServer.csproj b/TanksServer/TanksServer.csproj deleted file mode 100644 index bee9acf..0000000 --- a/TanksServer/TanksServer.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - net8.0 - enable - disable - true - Linux - - - - Recommended - true - CA1805,CA1848 - - - - true - true - - false - true - true - true - - - - - - - - - - - - - Dockerfile - - - Dockerfile - - - - - - - - diff --git a/DisplayCommands/ByteGrid.cs b/tanks-backend/DisplayCommands/ByteGrid.cs similarity index 100% rename from DisplayCommands/ByteGrid.cs rename to tanks-backend/DisplayCommands/ByteGrid.cs diff --git a/DisplayCommands/Cp437Grid.cs b/tanks-backend/DisplayCommands/Cp437Grid.cs similarity index 100% rename from DisplayCommands/Cp437Grid.cs rename to tanks-backend/DisplayCommands/Cp437Grid.cs diff --git a/DisplayCommands/DisplayCommands.csproj b/tanks-backend/DisplayCommands/DisplayCommands.csproj similarity index 73% rename from DisplayCommands/DisplayCommands.csproj rename to tanks-backend/DisplayCommands/DisplayCommands.csproj index eb5123d..ca146b4 100644 --- a/DisplayCommands/DisplayCommands.csproj +++ b/tanks-backend/DisplayCommands/DisplayCommands.csproj @@ -1,18 +1,10 @@  - - net8.0 - disable - enable - true - true - true - + - Recommended - true - CA1805,CA1848 + true + true diff --git a/DisplayCommands/DisplayConfiguration.cs b/tanks-backend/DisplayCommands/DisplayConfiguration.cs similarity index 100% rename from DisplayCommands/DisplayConfiguration.cs rename to tanks-backend/DisplayCommands/DisplayConfiguration.cs diff --git a/DisplayCommands/DisplayExtensions.cs b/tanks-backend/DisplayCommands/DisplayExtensions.cs similarity index 100% rename from DisplayCommands/DisplayExtensions.cs rename to tanks-backend/DisplayCommands/DisplayExtensions.cs diff --git a/DisplayCommands/GlobalUsings.cs b/tanks-backend/DisplayCommands/GlobalUsings.cs similarity index 100% rename from DisplayCommands/GlobalUsings.cs rename to tanks-backend/DisplayCommands/GlobalUsings.cs diff --git a/DisplayCommands/IDisplayConnection.cs b/tanks-backend/DisplayCommands/IDisplayConnection.cs similarity index 100% rename from DisplayCommands/IDisplayConnection.cs rename to tanks-backend/DisplayCommands/IDisplayConnection.cs diff --git a/DisplayCommands/Internals/DisplayCommand.cs b/tanks-backend/DisplayCommands/Internals/DisplayCommand.cs similarity index 100% rename from DisplayCommands/Internals/DisplayCommand.cs rename to tanks-backend/DisplayCommands/Internals/DisplayCommand.cs diff --git a/DisplayCommands/Internals/DisplayConnection.cs b/tanks-backend/DisplayCommands/Internals/DisplayConnection.cs similarity index 100% rename from DisplayCommands/Internals/DisplayConnection.cs rename to tanks-backend/DisplayCommands/Internals/DisplayConnection.cs diff --git a/DisplayCommands/Internals/DisplaySubCommand.cs b/tanks-backend/DisplayCommands/Internals/DisplaySubCommand.cs similarity index 100% rename from DisplayCommands/Internals/DisplaySubCommand.cs rename to tanks-backend/DisplayCommands/Internals/DisplaySubCommand.cs diff --git a/DisplayCommands/Internals/HeaderBitmap.cs b/tanks-backend/DisplayCommands/Internals/HeaderBitmap.cs similarity index 100% rename from DisplayCommands/Internals/HeaderBitmap.cs rename to tanks-backend/DisplayCommands/Internals/HeaderBitmap.cs diff --git a/DisplayCommands/Internals/HeaderWindow.cs b/tanks-backend/DisplayCommands/Internals/HeaderWindow.cs similarity index 100% rename from DisplayCommands/Internals/HeaderWindow.cs rename to tanks-backend/DisplayCommands/Internals/HeaderWindow.cs diff --git a/DisplayCommands/PixelGrid.cs b/tanks-backend/DisplayCommands/PixelGrid.cs similarity index 100% rename from DisplayCommands/PixelGrid.cs rename to tanks-backend/DisplayCommands/PixelGrid.cs diff --git a/EndiannessSourceGenerator/EndiannessGenerator.cs b/tanks-backend/EndiannessSourceGenerator/EndiannessGenerator.cs similarity index 87% rename from EndiannessSourceGenerator/EndiannessGenerator.cs rename to tanks-backend/EndiannessSourceGenerator/EndiannessGenerator.cs index 046b4c6..eb772e5 100644 --- a/EndiannessSourceGenerator/EndiannessGenerator.cs +++ b/tanks-backend/EndiannessSourceGenerator/EndiannessGenerator.cs @@ -171,35 +171,36 @@ public class StructEndiannessSourceGenerator : ISourceGenerator return PropertyDeclaration(ParseTypeName(typeName), propertyName) .WithModifiers(TokenList([Token(SyntaxKind.PublicKeyword)])) .WithAccessorList(AccessorList(List([ - AccessorDeclaration(SyntaxKind.GetAccessorDeclaration) - .WithExpressionBody(ArrowExpressionClause(ConditionalExpression( - condition: condition, - whenTrue: fieldIdentifier, - whenFalse: InvocationExpression( - expression: reverseEndiannessMethod, - argumentList: ArgumentList(SingletonSeparatedList( - Argument(fieldIdentifier) - )) - ) - ))) - .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), - AccessorDeclaration(SyntaxKind.SetAccessorDeclaration) - .WithExpressionBody(ArrowExpressionClause(AssignmentExpression( - kind: SyntaxKind.SimpleAssignmentExpression, - left: fieldIdentifier, - right: ConditionalExpression( + AccessorDeclaration(SyntaxKind.GetAccessorDeclaration) + .WithExpressionBody(ArrowExpressionClause(ConditionalExpression( condition: condition, - whenTrue: valueIdentifier, + whenTrue: fieldIdentifier, whenFalse: InvocationExpression( expression: reverseEndiannessMethod, argumentList: ArgumentList(SingletonSeparatedList( - Argument(valueIdentifier) + Argument(fieldIdentifier) )) ) - ) - ))) - .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) - ]))); + ))) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)), + AccessorDeclaration(SyntaxKind.SetAccessorDeclaration) + .WithExpressionBody(ArrowExpressionClause(AssignmentExpression( + kind: SyntaxKind.SimpleAssignmentExpression, + left: fieldIdentifier, + right: ConditionalExpression( + condition: condition, + whenTrue: valueIdentifier, + whenFalse: InvocationExpression( + expression: reverseEndiannessMethod, + argumentList: ArgumentList(SingletonSeparatedList( + Argument(valueIdentifier) + )) + ) + ) + ))) + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) + ])) + ); } private static SyntaxToken GeneratePropertyName(string fieldName) diff --git a/EndiannessSourceGenerator/EndiannessSourceGenerator.csproj b/tanks-backend/EndiannessSourceGenerator/EndiannessSourceGenerator.csproj similarity index 90% rename from EndiannessSourceGenerator/EndiannessSourceGenerator.csproj rename to tanks-backend/EndiannessSourceGenerator/EndiannessSourceGenerator.csproj index 99670d2..ae25c62 100644 --- a/EndiannessSourceGenerator/EndiannessSourceGenerator.csproj +++ b/tanks-backend/EndiannessSourceGenerator/EndiannessSourceGenerator.csproj @@ -1,5 +1,7 @@ + + netstandard2.0 false @@ -9,6 +11,7 @@ true true EndiannessSourceGenerator + false @@ -17,7 +20,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/tanks-backend/EndiannessSourceGenerator/Properties/launchSettings.json b/tanks-backend/EndiannessSourceGenerator/Properties/launchSettings.json new file mode 100644 index 0000000..b8b1379 --- /dev/null +++ b/tanks-backend/EndiannessSourceGenerator/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "Generators": { + "commandName": "DebugRoslynComponent", + "targetProject": "../DisplayCommands/DisplayCommands.csproj" + } + } +} diff --git a/EndiannessSourceGenerator/Readme.md b/tanks-backend/EndiannessSourceGenerator/Readme.md similarity index 100% rename from EndiannessSourceGenerator/Readme.md rename to tanks-backend/EndiannessSourceGenerator/Readme.md diff --git a/TanksServer.sln b/tanks-backend/TanksServer.sln similarity index 88% rename from TanksServer.sln rename to tanks-backend/TanksServer.sln index 644ced9..8f288c4 100644 --- a/TanksServer.sln +++ b/tanks-backend/TanksServer.sln @@ -6,6 +6,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DisplayCommands", "DisplayC EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EndiannessSourceGenerator", "EndiannessSourceGenerator\EndiannessSourceGenerator.csproj", "{D77FE880-F2B8-43B6-8B33-B6FA089CC337}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{12DB7D48-1BB2-488B-B4D9-4126087D2F8C}" + ProjectSection(SolutionItems) = preProject + global.json = global.json + shared.props = shared.props + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/TanksServer/Endpoints.cs b/tanks-backend/TanksServer/Endpoints.cs similarity index 99% rename from TanksServer/Endpoints.cs rename to tanks-backend/TanksServer/Endpoints.cs index a98c351..8685f63 100644 --- a/TanksServer/Endpoints.cs +++ b/tanks-backend/TanksServer/Endpoints.cs @@ -75,5 +75,4 @@ internal static class Endpoints return Results.Ok(); }); } - } diff --git a/TanksServer/GameLogic/CollectPowerUp.cs b/tanks-backend/TanksServer/GameLogic/CollectPowerUp.cs similarity index 100% rename from TanksServer/GameLogic/CollectPowerUp.cs rename to tanks-backend/TanksServer/GameLogic/CollectPowerUp.cs diff --git a/TanksServer/GameLogic/CollideBullets.cs b/tanks-backend/TanksServer/GameLogic/CollideBullets.cs similarity index 100% rename from TanksServer/GameLogic/CollideBullets.cs rename to tanks-backend/TanksServer/GameLogic/CollideBullets.cs diff --git a/TanksServer/GameLogic/GameRules.cs b/tanks-backend/TanksServer/GameLogic/GameRules.cs similarity index 100% rename from TanksServer/GameLogic/GameRules.cs rename to tanks-backend/TanksServer/GameLogic/GameRules.cs diff --git a/TanksServer/GameLogic/GameTickWorker.cs b/tanks-backend/TanksServer/GameLogic/GameTickWorker.cs similarity index 100% rename from TanksServer/GameLogic/GameTickWorker.cs rename to tanks-backend/TanksServer/GameLogic/GameTickWorker.cs diff --git a/TanksServer/GameLogic/ITickStep.cs b/tanks-backend/TanksServer/GameLogic/ITickStep.cs similarity index 100% rename from TanksServer/GameLogic/ITickStep.cs rename to tanks-backend/TanksServer/GameLogic/ITickStep.cs diff --git a/TanksServer/GameLogic/MapEntityManager.cs b/tanks-backend/TanksServer/GameLogic/MapEntityManager.cs similarity index 100% rename from TanksServer/GameLogic/MapEntityManager.cs rename to tanks-backend/TanksServer/GameLogic/MapEntityManager.cs diff --git a/TanksServer/GameLogic/MapService.cs b/tanks-backend/TanksServer/GameLogic/MapService.cs similarity index 100% rename from TanksServer/GameLogic/MapService.cs rename to tanks-backend/TanksServer/GameLogic/MapService.cs diff --git a/TanksServer/GameLogic/MoveBullets.cs b/tanks-backend/TanksServer/GameLogic/MoveBullets.cs similarity index 100% rename from TanksServer/GameLogic/MoveBullets.cs rename to tanks-backend/TanksServer/GameLogic/MoveBullets.cs diff --git a/TanksServer/GameLogic/MoveTanks.cs b/tanks-backend/TanksServer/GameLogic/MoveTanks.cs similarity index 100% rename from TanksServer/GameLogic/MoveTanks.cs rename to tanks-backend/TanksServer/GameLogic/MoveTanks.cs diff --git a/TanksServer/GameLogic/RotateTanks.cs b/tanks-backend/TanksServer/GameLogic/RotateTanks.cs similarity index 100% rename from TanksServer/GameLogic/RotateTanks.cs rename to tanks-backend/TanksServer/GameLogic/RotateTanks.cs diff --git a/TanksServer/GameLogic/ShootFromTanks.cs b/tanks-backend/TanksServer/GameLogic/ShootFromTanks.cs similarity index 100% rename from TanksServer/GameLogic/ShootFromTanks.cs rename to tanks-backend/TanksServer/GameLogic/ShootFromTanks.cs diff --git a/TanksServer/GameLogic/SpawnPowerUp.cs b/tanks-backend/TanksServer/GameLogic/SpawnPowerUp.cs similarity index 100% rename from TanksServer/GameLogic/SpawnPowerUp.cs rename to tanks-backend/TanksServer/GameLogic/SpawnPowerUp.cs diff --git a/TanksServer/GameLogic/TankSpawnQueue.cs b/tanks-backend/TanksServer/GameLogic/TankSpawnQueue.cs similarity index 95% rename from TanksServer/GameLogic/TankSpawnQueue.cs rename to tanks-backend/TanksServer/GameLogic/TankSpawnQueue.cs index e622748..447cec9 100644 --- a/TanksServer/GameLogic/TankSpawnQueue.cs +++ b/tanks-backend/TanksServer/GameLogic/TankSpawnQueue.cs @@ -20,7 +20,7 @@ internal sealed class TankSpawnQueue( _spawnTimes.AddOrUpdate(player, DateTime.MinValue, (_, _) => DateTime.Now + _spawnDelay); } - public bool TryDequeueNext([MaybeNullWhen(false)] out Player player) + private bool TryDequeueNext([MaybeNullWhen(false)] out Player player) { if (!_queue.TryDequeue(out player)) return false; // no one on queue diff --git a/TanksServer/GlobalUsings.cs b/tanks-backend/TanksServer/GlobalUsings.cs similarity index 100% rename from TanksServer/GlobalUsings.cs rename to tanks-backend/TanksServer/GlobalUsings.cs diff --git a/TanksServer/Graphics/DrawBulletsStep.cs b/tanks-backend/TanksServer/Graphics/DrawBulletsStep.cs similarity index 100% rename from TanksServer/Graphics/DrawBulletsStep.cs rename to tanks-backend/TanksServer/Graphics/DrawBulletsStep.cs diff --git a/TanksServer/Graphics/DrawMapStep.cs b/tanks-backend/TanksServer/Graphics/DrawMapStep.cs similarity index 100% rename from TanksServer/Graphics/DrawMapStep.cs rename to tanks-backend/TanksServer/Graphics/DrawMapStep.cs diff --git a/TanksServer/Graphics/DrawPowerUpsStep.cs b/tanks-backend/TanksServer/Graphics/DrawPowerUpsStep.cs similarity index 100% rename from TanksServer/Graphics/DrawPowerUpsStep.cs rename to tanks-backend/TanksServer/Graphics/DrawPowerUpsStep.cs diff --git a/TanksServer/Graphics/DrawTanksStep.cs b/tanks-backend/TanksServer/Graphics/DrawTanksStep.cs similarity index 100% rename from TanksServer/Graphics/DrawTanksStep.cs rename to tanks-backend/TanksServer/Graphics/DrawTanksStep.cs diff --git a/TanksServer/Graphics/GamePixel.cs b/tanks-backend/TanksServer/Graphics/GamePixel.cs similarity index 100% rename from TanksServer/Graphics/GamePixel.cs rename to tanks-backend/TanksServer/Graphics/GamePixel.cs diff --git a/TanksServer/Graphics/GamePixelEntityType.cs b/tanks-backend/TanksServer/Graphics/GamePixelEntityType.cs similarity index 100% rename from TanksServer/Graphics/GamePixelEntityType.cs rename to tanks-backend/TanksServer/Graphics/GamePixelEntityType.cs diff --git a/TanksServer/Graphics/GamePixelGrid.cs b/tanks-backend/TanksServer/Graphics/GamePixelGrid.cs similarity index 100% rename from TanksServer/Graphics/GamePixelGrid.cs rename to tanks-backend/TanksServer/Graphics/GamePixelGrid.cs diff --git a/TanksServer/Graphics/GeneratePixelsTickStep.cs b/tanks-backend/TanksServer/Graphics/GeneratePixelsTickStep.cs similarity index 100% rename from TanksServer/Graphics/GeneratePixelsTickStep.cs rename to tanks-backend/TanksServer/Graphics/GeneratePixelsTickStep.cs diff --git a/TanksServer/Graphics/IDrawStep.cs b/tanks-backend/TanksServer/Graphics/IDrawStep.cs similarity index 100% rename from TanksServer/Graphics/IDrawStep.cs rename to tanks-backend/TanksServer/Graphics/IDrawStep.cs diff --git a/TanksServer/Graphics/IFrameConsumer.cs b/tanks-backend/TanksServer/Graphics/IFrameConsumer.cs similarity index 100% rename from TanksServer/Graphics/IFrameConsumer.cs rename to tanks-backend/TanksServer/Graphics/IFrameConsumer.cs diff --git a/TanksServer/Interactivity/AppSerializerContext.cs b/tanks-backend/TanksServer/Interactivity/AppSerializerContext.cs similarity index 100% rename from TanksServer/Interactivity/AppSerializerContext.cs rename to tanks-backend/TanksServer/Interactivity/AppSerializerContext.cs diff --git a/TanksServer/Interactivity/ByteChannelWebSocket.cs b/tanks-backend/TanksServer/Interactivity/ByteChannelWebSocket.cs similarity index 100% rename from TanksServer/Interactivity/ByteChannelWebSocket.cs rename to tanks-backend/TanksServer/Interactivity/ByteChannelWebSocket.cs diff --git a/TanksServer/Interactivity/ClientScreenServer.cs b/tanks-backend/TanksServer/Interactivity/ClientScreenServer.cs similarity index 100% rename from TanksServer/Interactivity/ClientScreenServer.cs rename to tanks-backend/TanksServer/Interactivity/ClientScreenServer.cs diff --git a/TanksServer/Interactivity/ClientScreenServerConnection.cs b/tanks-backend/TanksServer/Interactivity/ClientScreenServerConnection.cs similarity index 100% rename from TanksServer/Interactivity/ClientScreenServerConnection.cs rename to tanks-backend/TanksServer/Interactivity/ClientScreenServerConnection.cs diff --git a/TanksServer/Interactivity/ControlsServer.cs b/tanks-backend/TanksServer/Interactivity/ControlsServer.cs similarity index 100% rename from TanksServer/Interactivity/ControlsServer.cs rename to tanks-backend/TanksServer/Interactivity/ControlsServer.cs diff --git a/TanksServer/Interactivity/PlayerScreenData.cs b/tanks-backend/TanksServer/Interactivity/PlayerScreenData.cs similarity index 100% rename from TanksServer/Interactivity/PlayerScreenData.cs rename to tanks-backend/TanksServer/Interactivity/PlayerScreenData.cs diff --git a/TanksServer/Interactivity/PlayerServer.cs b/tanks-backend/TanksServer/Interactivity/PlayerServer.cs similarity index 100% rename from TanksServer/Interactivity/PlayerServer.cs rename to tanks-backend/TanksServer/Interactivity/PlayerServer.cs diff --git a/TanksServer/Interactivity/SendToServicePointDisplay.cs b/tanks-backend/TanksServer/Interactivity/SendToServicePointDisplay.cs similarity index 100% rename from TanksServer/Interactivity/SendToServicePointDisplay.cs rename to tanks-backend/TanksServer/Interactivity/SendToServicePointDisplay.cs diff --git a/TanksServer/Models/Bullet.cs b/tanks-backend/TanksServer/Models/Bullet.cs similarity index 100% rename from TanksServer/Models/Bullet.cs rename to tanks-backend/TanksServer/Models/Bullet.cs diff --git a/TanksServer/Models/FloatPosition.cs b/tanks-backend/TanksServer/Models/FloatPosition.cs similarity index 100% rename from TanksServer/Models/FloatPosition.cs rename to tanks-backend/TanksServer/Models/FloatPosition.cs diff --git a/TanksServer/Models/HostConfiguration.cs b/tanks-backend/TanksServer/Models/HostConfiguration.cs similarity index 100% rename from TanksServer/Models/HostConfiguration.cs rename to tanks-backend/TanksServer/Models/HostConfiguration.cs diff --git a/TanksServer/Models/IMapEntity.cs b/tanks-backend/TanksServer/Models/IMapEntity.cs similarity index 100% rename from TanksServer/Models/IMapEntity.cs rename to tanks-backend/TanksServer/Models/IMapEntity.cs diff --git a/TanksServer/Models/PixelBounds.cs b/tanks-backend/TanksServer/Models/PixelBounds.cs similarity index 100% rename from TanksServer/Models/PixelBounds.cs rename to tanks-backend/TanksServer/Models/PixelBounds.cs diff --git a/TanksServer/Models/PixelPosition.cs b/tanks-backend/TanksServer/Models/PixelPosition.cs similarity index 100% rename from TanksServer/Models/PixelPosition.cs rename to tanks-backend/TanksServer/Models/PixelPosition.cs diff --git a/TanksServer/Models/Player.cs b/tanks-backend/TanksServer/Models/Player.cs similarity index 100% rename from TanksServer/Models/Player.cs rename to tanks-backend/TanksServer/Models/Player.cs diff --git a/TanksServer/Models/PlayerControls.cs b/tanks-backend/TanksServer/Models/PlayerControls.cs similarity index 100% rename from TanksServer/Models/PlayerControls.cs rename to tanks-backend/TanksServer/Models/PlayerControls.cs diff --git a/TanksServer/Models/PositionHelpers.cs b/tanks-backend/TanksServer/Models/PositionHelpers.cs similarity index 100% rename from TanksServer/Models/PositionHelpers.cs rename to tanks-backend/TanksServer/Models/PositionHelpers.cs diff --git a/TanksServer/Models/PowerUp.cs b/tanks-backend/TanksServer/Models/PowerUp.cs similarity index 100% rename from TanksServer/Models/PowerUp.cs rename to tanks-backend/TanksServer/Models/PowerUp.cs diff --git a/TanksServer/Models/Scores.cs b/tanks-backend/TanksServer/Models/Scores.cs similarity index 100% rename from TanksServer/Models/Scores.cs rename to tanks-backend/TanksServer/Models/Scores.cs diff --git a/TanksServer/Models/Tank.cs b/tanks-backend/TanksServer/Models/Tank.cs similarity index 100% rename from TanksServer/Models/Tank.cs rename to tanks-backend/TanksServer/Models/Tank.cs diff --git a/TanksServer/Models/TilePosition.cs b/tanks-backend/TanksServer/Models/TilePosition.cs similarity index 100% rename from TanksServer/Models/TilePosition.cs rename to tanks-backend/TanksServer/Models/TilePosition.cs diff --git a/TanksServer/Program.cs b/tanks-backend/TanksServer/Program.cs similarity index 98% rename from TanksServer/Program.cs rename to tanks-backend/TanksServer/Program.cs index b5b4b89..42782bf 100644 --- a/TanksServer/Program.cs +++ b/tanks-backend/TanksServer/Program.cs @@ -14,7 +14,7 @@ internal sealed record class NameId(string Name, Guid Id); public static class Program { - public static void Main(string[] args) + public static async Task Main(string[] args) { var app = Configure(args); @@ -24,7 +24,7 @@ public static class Program Endpoints.MapEndpoints(app); - app.Run(); + await app.RunAsync(); } private static WebApplication Configure(string[] args) diff --git a/TanksServer/Properties/launchSettings.json b/tanks-backend/TanksServer/Properties/launchSettings.json similarity index 100% rename from TanksServer/Properties/launchSettings.json rename to tanks-backend/TanksServer/Properties/launchSettings.json diff --git a/tanks-backend/TanksServer/TanksServer.csproj b/tanks-backend/TanksServer/TanksServer.csproj new file mode 100644 index 0000000..f2c2490 --- /dev/null +++ b/tanks-backend/TanksServer/TanksServer.csproj @@ -0,0 +1,26 @@ + + + + + + true + + false + true + true + true + + + + + + + + + + + + + + + diff --git a/TanksServer/appsettings.json b/tanks-backend/TanksServer/appsettings.json similarity index 100% rename from TanksServer/appsettings.json rename to tanks-backend/TanksServer/appsettings.json diff --git a/TanksServer/assets/maps/buggie.txt b/tanks-backend/TanksServer/assets/maps/buggie.txt similarity index 100% rename from TanksServer/assets/maps/buggie.txt rename to tanks-backend/TanksServer/assets/maps/buggie.txt diff --git a/tanks-backend/TanksServer/assets/maps/chaosknoten.png b/tanks-backend/TanksServer/assets/maps/chaosknoten.png new file mode 100644 index 0000000000000000000000000000000000000000..54a8740242c2e036abd532d0049e01e2854aac5d GIT binary patch literal 2299 zcmeAS@N?(olHy`uVBq!ia0y~yU`$|OU|7Jx#=yW}^lzIF0|Ns~v6E*A2L}g74M$1` z0|Un1@ExrQ_qV;> z$avw7{a${CgwX%r>>BRL@!K=Rz5RXfw?G2tZ?gzar-Wy!I~MwUW)NGDEp+Zf^kfFH zT{40f)~u*v;Ewm=ND2!o6>Ishbc)$wuT?z_*(FNKiwj-i>aWk8xpa2hvcp$D8%t!* zdtP3D`-E5>w>)F~+YDv)_sieUd1{?%wNLx4^6AQ!49$Bj(mR`Lxu+a|JhAG@^~X29 z)yn^>a$fR|(WWZhruffHXNecfvl;s3_W93rw#fc5J?8hC`;70ncppr)KBZ$mdDP@3Z$-szIf-zOVCU-Iqek20Rfb*^onS!_${Im|bo+4}IJ zh5s23hVW~}Pt>+3Y+uH>=hb{t@jVR9KcmnfeKLYS&hm?5^8|)#6VDr7 zVy??FV-mBg-?E0izvNthU+I$fOzEv>n9ce>&s+St{QI4$ExTTu^l6{&PK%P{H+>*t zbaqn3x(CbFOu7B~>(1)4G4Jgz>7LlPs`mcn(k8)siyr6qAAkIM>(6WF=Ka6BHP@X} zY2vJ<9XSu}HizZ@^{ZYP`|Xho;~bx5RR*Ol-&$Ai5BhRb=1Rllm9hNSR{r`OnZCZ# zcIt#ryKR}u)YmRP>hH4nVa>Xj>pV+4!ld_|b7N4yw#iSu=X2*B(bRuN_PyMhT;d}6=+ylk(i51r&0&!1 z=+(JisM_J}^y8IuVcfS4)du!psY4U}?_{nw>F{2+@!N&@QXdwS%q!elvGCdR^eZda zXa5s(X5jbXIImi@q}r@y{kaJp|H`$4nj~&qWjA{g5~QUySE}s$+8si-o>VebFiHKX zIoDG7L{B^X*~ee3W%GqtR6?}xted8qHAT74F1huN0aIH`-8s&4AC4vW8^k2G=r$xW zOiZjvyL1V$Sk=2{>#fB{@$KxVrs5Z0-rN^< zLX7`mLV%$818wQTG~PFYrZ1lxtc!>3OH!4xHqSkGncU zeoyZ4+}xw$s#(GZI;Xa+->P`+vQx_UXGa@685GeoIn+oV&H) zVJ%>mJZwJOnET+Gn!0_OHz)46x@MNYSNWM4 zwRRgA+B{RMfZ$mv*>Yo?BxyXa9t(&ke70`8+Wc#q(>Ard z*Xe0!*07D)?B%|C<+X09wadEK-cjGh@*#)+af|+5SD)*z3|-fLS$KPUy}6R|1Gg%Z z89eJZT#D=8CbqTmP1f5`-XF`RzPt9J@55fb5|$XFM^dGZyp7V%H`Ug^P}q|5G(GWj z;6IU4_cIwsJRjZ+lZf7XIrT!)7D-F{ifd&H*kWFkPO*17e4?aB``?*2OP}vt_p|7j z&n1=*9?^dN1wE24OWvmN-M?3_KiP!wk4ca~aUZY5?N_4vbj5P#`%Y!(oAK|j_B)jgdo-D~?!y*uH{RB^k-;CR~W7~`%t$5*ds-k8hlEufp_)|0xd&t$fo=@Zf4 zHMgWToa6l58C94&t;R$8zyX^y&NCTjvkn}HcsGq@UCX)YRbm`#5 z|MsV|I+xye=9O5HwnbbyO89`oMD5Sz)j6U2-&b#zK5+GX5Hp+K>0g)s&yMQeU(Lb3 z#MtTP!>gD>gI+XZ6)pzc0G@dh^wWMrXm-W<3T*dAIT9NDSPVYwm(1F)EO_9+w%pIH?>UZZ zH85HU9$=U|gPo^4JFsenA#+k&q^R401L2EXZg#L31cdgw)}%@N&6~}@_QH(;Z0N!> zL3KCG7mt9ymJeS>tN|E~ORxwoJFa&zEvPpmY%v-qE%Tig+bpjo-O zUFB008Welw_T5fn;Rz{N9=7|?iSH*lBr@IwH=O%6;cW*4ThNJJzl(gCBsfY_MRq6s z$eS%?V9;>0>HA5W1cftR{1=oo92r1tuXTpNrp&)^)Q_gfm7`Ct)1WXn9=L1pj>Ravireo4f5+2E0 qCv1~Zy>MrD)cdT5yK`@UllOl$yJL-jwH^Zl1B0ilpUXO@geCxjcv71H literal 0 HcmV?d00001 diff --git a/TanksServer/assets/maps/orig.txt b/tanks-backend/TanksServer/assets/maps/orig.txt similarity index 100% rename from TanksServer/assets/maps/orig.txt rename to tanks-backend/TanksServer/assets/maps/orig.txt diff --git a/TanksServer/assets/maps/tanks.txt b/tanks-backend/TanksServer/assets/maps/tanks.txt similarity index 100% rename from TanksServer/assets/maps/tanks.txt rename to tanks-backend/TanksServer/assets/maps/tanks.txt diff --git a/TanksServer/assets/maps/test2.png b/tanks-backend/TanksServer/assets/maps/test2.png similarity index 100% rename from TanksServer/assets/maps/test2.png rename to tanks-backend/TanksServer/assets/maps/test2.png diff --git a/TanksServer/assets/maps/upside_down.txt b/tanks-backend/TanksServer/assets/maps/upside_down.txt similarity index 100% rename from TanksServer/assets/maps/upside_down.txt rename to tanks-backend/TanksServer/assets/maps/upside_down.txt diff --git a/TanksServer/assets/powerup_explosive.png b/tanks-backend/TanksServer/assets/powerup_explosive.png similarity index 100% rename from TanksServer/assets/powerup_explosive.png rename to tanks-backend/TanksServer/assets/powerup_explosive.png diff --git a/TanksServer/assets/tank.png b/tanks-backend/TanksServer/assets/tank.png similarity index 100% rename from TanksServer/assets/tank.png rename to tanks-backend/TanksServer/assets/tank.png diff --git a/TanksServer/userRequests.http b/tanks-backend/TanksServer/userRequests.http similarity index 62% rename from TanksServer/userRequests.http rename to tanks-backend/TanksServer/userRequests.http index 49fb9c3..18c60c8 100644 --- a/TanksServer/userRequests.http +++ b/tanks-backend/TanksServer/userRequests.http @@ -10,5 +10,8 @@ GET localhost/map ### -POST localhost/map?index=0 +POST localhost/map?name=chaosknoten.png +### + +POST localhost/map?name=tanks.txt diff --git a/global.json b/tanks-backend/global.json similarity index 100% rename from global.json rename to tanks-backend/global.json diff --git a/tanks-backend/shared.props b/tanks-backend/shared.props new file mode 100644 index 0000000..2417333 --- /dev/null +++ b/tanks-backend/shared.props @@ -0,0 +1,20 @@ + + + + net8.0 + disable + enable + + + + true + true + + + + Recommended + true + CA1805,CA1848 + + +