Exemplo n.º 1
0
 /**
  * ******************************************************* Game mgmt model calls.
  * *******************************************************
  */
 public boolean enterGameFromLobby(int gameId) {
   obj = ServerAccess.getCardGame(gameId);
   if (obj != null) {
     currentGame = (CardGame) obj;
     setGameId(gameId);
     isInGame = true;
     gameType = currentLobbyType;
     leaveGameLobby(currentLobbyType, currentLobbyNumber);
     ServerAccess.incrementNumGames(new AchievementRequest(player, gameType));
     return true;
   }
   return false;
 }
Exemplo n.º 2
0
  public boolean logout() {
    if (isInGame && gameType == CardGameType.Blackjack) {
      System.out.println("??");
      ((BlackJack) currentGame).removePlayer(player);
      updateGame();
    } else if (isInLobby) {
      leaveGameLobby(currentLobbyType, currentLobbyNumber);
    }

    Object isSuccess = ServerAccess.logoutRequest(player);
    if (isSuccess == null) {
      return false;
    }
    isLoggedIn = false;
    return (boolean) isSuccess;
  }