}
// If not, we can probably sit in
// TODO Buyin, reserve seat in the meantime
logger.debug("Clicked on PlayerSeatComposite, sit in if empty ...");
GameWindow containingGameWindow = getParent().getParent();
UserSeatedPlayer user = containingGameWindow.getUser();
PlayerState userSnapshot = getGameState().getPlayer(playerId);
if (userSnapshot != null) {
// Dont do anything if the user is already sitting in
return;
}
int amount = new BuyinDialog(getClientCore(), user.getCashierContext(), containingGameWindow
.getDetailedTable().getTableConfiguration().getBigBlind() * 100, true).open();
if (amount <= 0)
return;
try {
playerId = user.getId();
user.sitIn(seatId, amount);
// Update the button accordingly with which the user can sit
// in and out
Button sitInOutButton = getParent().getParent().getUserInputComposite().sitInOutButton;
sitInOutButton.setText("Sit Out");
sitInOutButton.setSelection(true);