Fixed bug showing game as Closed when disconnecting

This commit is contained in:
martin 2023-08-27 12:13:45 +02:00
parent c5490ec332
commit 25f70b8ae4

View File

@ -37,8 +37,7 @@ public class Game
[JsonInclude] public int Count => Players.Count;
[JsonInclude]
public bool IsGameStarted => Count > 0 && Players.All(player => player.State is State.InGame or State.Disconnected);
[JsonInclude] public bool IsGameStarted => Count > 0 && Players.Any(player => player.State is State.InGame);
public Player NextPlayer()
{
@ -48,7 +47,7 @@ public class Game
}
catch (DivideByZeroException)
{
throw new InvalidOperationException("There are no players in the game group.");
throw new InvalidOperationException("There are no players in the game.");
}
return Players[_currentPlayerIndex];