RoleInterface<TermType> role=pt.getRole();
MoveInterface<TermType> move=pt.getMove();//aqui se decide el movimiento
if(move==null || !currentState.isLegal(role, move)){//control movimientos ilegales
Player<TermType, State<TermType, ReasonerStateInfoType>> player = match.getPlayer(role);
String message = "Illegal move \""+move+"\" from "+player+ " in step "+step;
GameControllerErrorMessage errorMessage = new GameControllerErrorMessage(GameControllerErrorMessage.ILLEGAL_MOVE, message, player.getName());
match.notifyErrorMessage(errorMessage);
logger.log(Level.SEVERE, message, errorMessage);
move = currentState.getLegalMove(role);
if (move == null) {
message = "no legal move for "+role+" in step "+step+", state: "+currentState.toString();
errorMessage = new GameControllerErrorMessage(GameControllerErrorMessage.GAME_ERROR, message);
match.notifyErrorMessage(errorMessage);
throw new RuntimeException("GameController stopped because: "+message);
}
logger.log(Level.SEVERE, message, errorMessage);
jointMove.put(role,move);