b967bd70eb
- 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`.
19 lines
490 B
C#
19 lines
490 B
C#
using API.Models.DataClasses;
|
|
|
|
namespace API.Models.Game;
|
|
|
|
public enum GameState
|
|
{
|
|
Lobby,
|
|
Running,
|
|
Ended
|
|
}
|
|
|
|
public class Game(Coordinates gFs, SixDigitInt gameCode)
|
|
{
|
|
public string Id { get; init; } = Guid.NewGuid().ToString();
|
|
public SixDigitInt GameCode { get; } = gameCode;
|
|
public string?[] PlayerConnectionIds { get; set; } = new string?[2];
|
|
public GameState State { get; private set; } = GameState.Lobby;
|
|
public GameField Field { get; } = new(gFs);
|
|
} |