Package org.cspoker.common.api.shared.exception

Examples of org.cspoker.common.api.shared.exception.IllegalActionException


   * @throws IllegalActionException [must] The action performed is not a valid
   *             action.
   */
  public void fold(MutableSeatedPlayer player)
      throws IllegalActionException {
    throw new IllegalActionException(player.getName() + " can not fold in this round.");
  }
View Full Code Here


    throw new IllegalActionException(player.getName() + " can not fold in this round.");
  }
 
  public void foldAction(MutableSeatedPlayer player)
      throws IllegalActionException {
    throw new IllegalActionException(player.getName() + " can not fold in this round.");
  }
View Full Code Here

   * @throws IllegalActionException [must] The action performed is not a valid
   *             action.
   */
  public void deal(MutableSeatedPlayer player)
      throws IllegalActionException {
    throw new IllegalActionException(player.getName() + " can not deal in this round.");
  }
View Full Code Here

   * @throws IllegalActionException [must] The action performed is not a valid
   *             action.
   */
  public void allIn(MutableSeatedPlayer player)
      throws IllegalActionException {
    throw new IllegalActionException(player.getName() + " can not go all-in in this round.");
  }
View Full Code Here

  @Override
  public void deal(MutableSeatedPlayer player)
      throws IllegalActionException {
    // Check whether the given player can do this action.
    if (!onTurn(player)) {
      throw new IllegalActionException(player.getName() + " can not deal in this round.");
    }
    game.unpauzeGame();
    for (MutableSeatedPlayer newlySittingOut : game.getPlayersSittingOutNextRound().keySet()) {
      newlySittingOut.setSittingIn(false);
      for (Entry<MutableSeatedPlayer, Boolean> sitOutPlayer : game.getPlayersSittingOutNextRound().entrySet()) {
        gameMediator
            .publishSitOutEvent(new SitOutEvent(sitOutPlayer.getKey().getId()));
      }
    }
   
    if (!(game.getTable().getNbPlayers() > 1)) {
      throw new IllegalActionException("There should at least be 2 players to begin a new deal.");
    }
    playerMadeEvent(player);
    // This will force the game control to end the waiting round
    // and change to the preflop round.
  }
View Full Code Here

                }
              }   
          ));
      send(new ActionPerformedEvent<Void>(action, null));
    } catch (LoginException exception) {
      send(new IllegalActionEvent<Void>(action, new IllegalActionException("Bad Login.")));
    }
  }
View Full Code Here

 
  @Override
  public void check(MutableSeatedPlayer player)
      throws IllegalActionException {
    if (!onTurn(player)) {
      throw new IllegalActionException(player.getName() + " it is not your turn to act.");
    }
   
    if (game.getLastActionPlayer().getBetChips().getValue() > player.getBetChips().getValue()) {
      throw new IllegalActionException(player.getName() + " can not check in this round. "
          + game.getLastActionPlayer() + " has bet " + game.getLastActionPlayer().getBetChips().getValue()
          + " and you have only bet " + player.getBetChips().getValue());
     
    } else {
      bigBlindChecked = true;
View Full Code Here

                message = null;
        }

      public IllegalActionException getException() {
        if (exception == null) {
          exception = new IllegalActionException(message);
        }
        return exception;
      }
View Full Code Here

  }
 
  @Override
  public void allIn(MutableSeatedPlayer player)
      throws IllegalActionException {
    throw new IllegalActionException("Going all-in is not a valid action.");
  }
View Full Code Here

  }
 
  @Override
  public void bet(MutableSeatedPlayer player, int amount)
      throws IllegalActionException {
    throw new IllegalActionException("Bet is not a valid action.");
  }
View Full Code Here

TOP

Related Classes of org.cspoker.common.api.shared.exception.IllegalActionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.