From e547f945fc485970226b082ef8739fa104251050 Mon Sep 17 00:00:00 2001 From: derole Date: Tue, 11 Nov 2025 01:32:43 +0000 Subject: [PATCH] Add classes for player/player creation/leaderboard apis --- .../Api/LeaderBoardApiController.cs | 21 +++++++++++++++++++ .../Controllers/Api/PlayerApiController.cs | 21 +++++++++++++++++++ .../Api/PlayerCreationApiController.cs | 21 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 GameServer/Controllers/Api/LeaderBoardApiController.cs create mode 100644 GameServer/Controllers/Api/PlayerApiController.cs create mode 100644 GameServer/Controllers/Api/PlayerCreationApiController.cs diff --git a/GameServer/Controllers/Api/LeaderBoardApiController.cs b/GameServer/Controllers/Api/LeaderBoardApiController.cs new file mode 100644 index 0000000..910bbe1 --- /dev/null +++ b/GameServer/Controllers/Api/LeaderBoardApiController.cs @@ -0,0 +1,21 @@ +using GameServer.Utils; +using Microsoft.AspNetCore.Mvc; + +namespace GameServer.Controllers.Api +{ + public class LeaderBoardApiController : Controller + { + private readonly Database database; + + public LeaderBoardApiController(Database database) + { + this.database = database; + } + + protected override void Dispose(bool disposing) + { + database.Dispose(); + base.Dispose(disposing); + } + } +} \ No newline at end of file diff --git a/GameServer/Controllers/Api/PlayerApiController.cs b/GameServer/Controllers/Api/PlayerApiController.cs new file mode 100644 index 0000000..718f3b5 --- /dev/null +++ b/GameServer/Controllers/Api/PlayerApiController.cs @@ -0,0 +1,21 @@ +using GameServer.Utils; +using Microsoft.AspNetCore.Mvc; + +namespace GameServer.Controllers.Api +{ + public class PlayerApiController : Controller + { + private readonly Database database; + + public PlayerApiController(Database database) + { + this.database = database; + } + + protected override void Dispose(bool disposing) + { + database.Dispose(); + base.Dispose(disposing); + } + } +} \ No newline at end of file diff --git a/GameServer/Controllers/Api/PlayerCreationApiController.cs b/GameServer/Controllers/Api/PlayerCreationApiController.cs new file mode 100644 index 0000000..6815736 --- /dev/null +++ b/GameServer/Controllers/Api/PlayerCreationApiController.cs @@ -0,0 +1,21 @@ +using GameServer.Utils; +using Microsoft.AspNetCore.Mvc; + +namespace GameServer.Controllers.Api +{ + public class PlayerCreationApiController : Controller + { + private readonly Database database; + + public PlayerCreationApiController(Database database) + { + this.database = database; + } + + protected override void Dispose(bool disposing) + { + database.Dispose(); + base.Dispose(disposing); + } + } +} \ No newline at end of file