Add turn tracking and enforce turn order

Introduce CurrentTurn to Game (default 1) and expose it via GameInformationDto. Update GameManager to include CurrentTurn in the GameInformation payload, validate that a player can only Drop when it is their turn, and toggle CurrentTurn between 1 and 2 after a successful move. Also use a safe fallback (0) when game is null.
This commit is contained in:
Jonas
2026-03-05 17:33:56 +01:00
parent 3cb2a6c159
commit bec5df7e88
3 changed files with 9 additions and 1 deletions
+1
View File
@@ -14,6 +14,7 @@ public class Game(Coordinates gFs, SixDigitInt gameCode)
public string Id { get; init; } = Guid.NewGuid().ToString();
public SixDigitInt GameCode { get; } = gameCode;
public List<Player> Players { get; set; } = new();
public int CurrentTurn { get; set; } = 1;
public GameState State { get; private set; } = GameState.Lobby;
public GameField Field { get; } = new(gFs);