diff --git a/GameMicroServer/Controllers/PongController.cs b/GameMicroServer/Controllers/PongController.cs deleted file mode 100644 index 9b2fd2d..0000000 --- a/GameMicroServer/Controllers/PongController.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; - -using Microsoft.Extensions.Caching.Distributed; -using System.Text.Json; - -namespace Pong -{ - [ApiController] - [Route("[controller]")] - public class PongController : ControllerBase - { - private static readonly List TheInfo = new List - { - new GameInfo { - //Id = 1, - Title = "Snake", - //Content = "~/js/snake.js", - Author = "Fall 2023 Semester", - DateAdded = "", - Description = "Snake is a classic arcade game that challenges the player to control a snake-like creature that grows longer as it eats apples. The player must avoid hitting the walls or the snake's own body, which can end the game.\r\n", - HowTo = "Control with arrow keys.", - //Thumbnail = "/images/snake.jpg" //640x360 resolution - }, - new GameInfo { - //Id = 2, - Title = "Tetris", - //Content = "~/js/tetris.js", - Author = "Fall 2023 Semester", - DateAdded = "", - Description = "Tetris is a classic arcade puzzle game where the player has to arrange falling blocks, also known as Tetronimos, of different shapes and colors to form complete rows on the bottom of the screen. The game gets faster and harder as the player progresses, and ends when the Tetronimos reach the top of the screen.", - HowTo = "Control with arrow keys: Up arrow to spin, down to speed up fall, space to insta-drop.", - //Thumbnail = "/images/tetris.jpg" - }, - new GameInfo { - //Id = 3, - Title = "Pong", - //Content = "~/js/pong.js", - Author = "Fall 2023 Semester", - DateAdded = "", - Description = "Pong is a classic arcade game where the player uses a paddle to hit a ball against a computer's paddle. Either party scores when the ball makes it past the opponent's paddle.", - HowTo = "Control with arrow keys.", - //Thumbnail = "/images/pong.jpg" - }, - - }; - - private readonly ILogger _logger; - - public PongController(ILogger logger) - { - _logger = logger; - } - - [HttpGet] - public IEnumerable Get() - { - return TheInfo; - } - } -} \ No newline at end of file diff --git a/Pong.sln b/Pong.sln index 7fb5fc2..8a15603 100644 --- a/Pong.sln +++ b/Pong.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.7.34221.43 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pong", "GameMicroServer\Pong.csproj", "{C8787DE3-73A1-4FA9-BC23-865FCF0560AF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pong", "Pong\Pong.csproj", "{C8787DE3-73A1-4FA9-BC23-865FCF0560AF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Pong/Controllers/PongController.cs b/Pong/Controllers/PongController.cs new file mode 100644 index 0000000..6ae0c16 --- /dev/null +++ b/Pong/Controllers/PongController.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; + +using Microsoft.Extensions.Caching.Distributed; +using System.Text.Json; + +namespace Pong +{ + [ApiController] + [Route("[controller]")] + public class PongController : ControllerBase + { + private static readonly List TheInfo = new List + { + new GameInfo { + Id = 3, + Title = "Pong", + Content = "~/js/pong.js", + Author = "Fall 2023 Semester", + DateAdded = "", + Description = "Pong is a classic arcade game where the player uses a paddle to hit a ball against a computer's paddle. Either party scores when the ball makes it past the opponent's paddle.", + HowTo = "Control with arrow keys.", + Thumbnail = "/images/pong.jpg" + } + + }; + + private readonly ILogger _logger; + + public PongController(ILogger logger) + { + _logger = logger; + } + + [HttpGet] + public IEnumerable Get() + { + return TheInfo; + } + } +} \ No newline at end of file diff --git a/GameMicroServer/Dockerfile b/Pong/Dockerfile similarity index 100% rename from GameMicroServer/Dockerfile rename to Pong/Dockerfile diff --git a/GameMicroServer/GameInfo.cs b/Pong/GameInfo.cs similarity index 68% rename from GameMicroServer/GameInfo.cs rename to Pong/GameInfo.cs index b98b50f..1dfb716 100644 --- a/GameMicroServer/GameInfo.cs +++ b/Pong/GameInfo.cs @@ -2,10 +2,13 @@ { public class GameInfo { + public int Id { get; set; } public string Title { get; set; } public string Author { get; set; } + public string Content { get; set; } public string Description { get; set; } public string DateAdded { get; set; } public string HowTo { get; set; } + public string Thumbnail { get; set; } } } \ No newline at end of file diff --git a/GameMicroServer/Pong.csproj b/Pong/Pong.csproj similarity index 100% rename from GameMicroServer/Pong.csproj rename to Pong/Pong.csproj diff --git a/GameMicroServer/Program.cs b/Pong/Program.cs similarity index 100% rename from GameMicroServer/Program.cs rename to Pong/Program.cs diff --git a/GameMicroServer/Properties/launchSettings.json b/Pong/Properties/launchSettings.json similarity index 100% rename from GameMicroServer/Properties/launchSettings.json rename to Pong/Properties/launchSettings.json diff --git a/GameMicroServer/appsettings.Development.json b/Pong/appsettings.Development.json similarity index 100% rename from GameMicroServer/appsettings.Development.json rename to Pong/appsettings.Development.json diff --git a/GameMicroServer/appsettings.json b/Pong/appsettings.json similarity index 100% rename from GameMicroServer/appsettings.json rename to Pong/appsettings.json