public bool checkIfGameStarted(Guid gameLobbyGuidP) { GameLobby gl = getGameLobby(gameLobbyGuidP); if (gl != null) { if (gl.getStatus().CompareTo(GameLobbyStatus.Game_In_Progress) == 0) { //Game started return(true); } else if (gl.areAllClientsReady()) { //Game not started but all clients are ready GameLobbyStatus gls = gl.getStatus(); if (gls.CompareTo(GameLobbyStatus.Enough_Players_To_Start) == 0 || gls.CompareTo(GameLobbyStatus.Full) == 0) { //There is enough clients to start a game and they are all ready if (startGame(gameLobbyGuidP)) { //At this point a new game has been started. return(true); } } } } return(false); }
public bool setGameLobbyStatus(Guid gamelobbyGuidP, GameLobbyStatus status) { GameLobby gl = getGameLobby(gamelobbyGuidP); gl.setStatus(status); return(true); }
internal void setStatus(GameLobbyStatus s) { status = s; setDescription(); }
public bool setGameLobbyStatus(Guid gamelobbyGuidP, GameLobbyStatus status) { GameLobby gl = getGameLobby(gamelobbyGuidP); gl.setStatus(status); return true; }