Refactor and clean up codebase:

- Introduced `IGameRepository` interface and its implementation.
- Transitioned namespaces to `file-scoped` for consistency.
- Simplified class definitions, e.g., `Game` and `SixDigitInt`.
- Restructured `GameField` logic for improved readability and functionality.
- Fixed formatting issues in `API.csproj` and added a `using` directive in `Program.cs`.
This commit is contained in:
2026-02-27 20:36:44 +01:00
committed by Jonas
parent 5db7ac1676
commit b967bd70eb
11 changed files with 153 additions and 157 deletions
+16 -17
View File
@@ -1,20 +1,19 @@
namespace API.Services.GameManager
namespace API.Services.GameManager;
public class GameManager : IGameManager
{
public class GameManager : IGameManager
public int CreateGame(string playerName)
{
public int CreateGame(string playerName)
{
throw new NotImplementedException();
}
public bool JoinGame(string playerName, int gameCode)
{
throw new NotImplementedException();
}
private int GenerateNonExistingGameCode()
{
return 0;
}
throw new NotImplementedException();
}
}
public bool JoinGame(string playerName, int gameCode)
{
throw new NotImplementedException();
}
private int GenerateNonExistingGameCode()
{
return 0;
}
}
+6 -7
View File
@@ -1,8 +1,7 @@
namespace API.Services.GameManager
namespace API.Services.GameManager;
public interface IGameManager
{
public interface IGameManager
{
public int CreateGame(string playerName);
public bool JoinGame(string playerName, int gameCode);
}
}
public int CreateGame(string playerName);
public bool JoinGame(string playerName, int gameCode);
}