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

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


  }
 
  @Override
  public void call(MutableSeatedPlayer player)
      throws IllegalActionException {
    throw new IllegalActionException("Call is not a valid action.");
  }
View Full Code Here


  }
 
  @Override
  public void check(MutableSeatedPlayer player)
      throws IllegalActionException {
    throw new IllegalActionException("Check is not a valid action.");
  }
View Full Code Here

  }
 
  @Override
  public void deal()
      throws IllegalActionException {
    throw new IllegalActionException("Deal is not a valid action.");
  }
View Full Code Here

  }
 
  @Override
  public void fold(MutableSeatedPlayer player)
      throws IllegalActionException {
    throw new IllegalActionException("Fold is not a valid action.");
   
  }
View Full Code Here

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

    try {
      if (seatId == null) {
        try {
          seatId = serverTable.addPlayer(player);
        } catch (PlayerListFullException e) {
          throw new IllegalActionException("Joining table " + mediatingTable.getTableId().toString()
              + " failed: " + e.getMessage());
        }
      }else{
        serverTable.addPlayer(seatId, player);
      }
    } catch (SeatTakenException e) {
      throw new IllegalActionException("Joining table " + mediatingTable.getTableId().toString()
          + " is not a valid action." + e.getMessage());
    } catch (IllegalActionException e) {
      throw new IllegalActionException("Joining table " + mediatingTable.getTableId().toString()
          + " is not a valid action." + e.getMessage());
    }
    player.setSittingIn(true);
    mediatingTable.publishSitInEvent(new SitInEvent(player.getMemento()));
    return new HoldemPlayerContextImpl(player, mediatingTable);
View Full Code Here

  public synchronized HoldemPlayerContext sitIn(SeatId seatId, MutableSeatedPlayer player)
  throws IllegalActionException {
    try {
      game.sitIn(seatId, player);
    } catch (SeatTakenException e) {
      throw new IllegalActionException(e.getMessage());
    }

    mediatingTable.publishSitInEvent(new SitInEvent(player.getMemento()));
    return new HoldemPlayerContextImpl(player, mediatingTable);
  }
View Full Code Here

  }
 
  public synchronized void startGame()
      throws IllegalActionException {
    if(configuration.isAutoDeal())
      throw new IllegalActionException("This functionality is not available in auto-deal games.");
    if(sitInPlayers.size()<2)
      throw new IllegalActionException("There should be at least 2 players before a game can start.");
    if (!tableState.isPlaying()){
      tableState = tableState.getNextState();
    }
    tableState.deal();
  }
View Full Code Here

      throw new IllegalArgumentException("The given player should be effective.");
    if (holdemTableListener == null)
      throw new IllegalArgumentException("The given holdem table listener should be effective.");
   
    if (joinedPlayers.putIfAbsent(player.getId(), holdemTableListener) != null)
      throw new IllegalActionException(player.toString() + " is already joined at this table.");
   
    publishJoinTableEvent(new JoinTableEvent(player.getId()));
    subscribeHoldemTableListener(holdemTableListener);
    return new HoldemTableContextImpl(player, this);
  }
View Full Code Here

          tableState = tableState.getNextState();
          tableState.deal();
      }
      return toReturn;
    } catch (IllegalArgumentException e) {
      throw new IllegalActionException("You can not sit in to this table with the given buy-in of " + buyIn
          + "chips.");
    }
   
  }
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.