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
+21 -16
View File
@@ -1,20 +1,25 @@
namespace API.Models.DataClasses
namespace API.Models.DataClasses;
public readonly record struct SixDigitInt
{
public readonly record struct SixDigitInt
public SixDigitInt(int value)
{
public int Value { get; }
if (value < 0 || value > 999999)
throw new ArgumentOutOfRangeException(nameof(value),
"Wert muss zwischen 0 und 999999 liegen.");
public SixDigitInt(int value)
{
if (value < 0 || value > 999999)
throw new ArgumentOutOfRangeException(nameof(value),
"Wert muss zwischen 0 und 999999 liegen.");
Value = value;
}
public override string ToString() => Value.ToString("D6");
public static implicit operator int(SixDigitInt v) => v.Value;
Value = value;
}
}
public int Value { get; }
public override string ToString()
{
return Value.ToString("D6");
}
public static implicit operator int(SixDigitInt v)
{
return v.Value;
}
}