fix(lobby): ready status anzeigen und Spielstart absichern

This commit is contained in:
Tim Krampitz
2026-09-10 21:52:21 +02:00
parent 01e62652f5
commit 01b6a41bc6
6 changed files with 43 additions and 6 deletions

View File

@@ -81,6 +81,9 @@ public class GameService : IGameService
if (game.Players.Count < 2)
throw new InvalidOperationException("At least 2 players are required to start the game");
if (game.Players.Any(player => !player.IsReady))
throw new InvalidOperationException("All players must be ready to start the game");
game.Status = GameStatus.InProgress;
game.StartedAt = DateTime.UtcNow;