/** * gets the selected, configured bot from the dialog * * @param host The game server's host address. * @param port The gme server's host port. * @return A new bot-controlled client. */ BotClient getSelectedBot(String host, int port) { if (testBotRadiobutton.isSelected()) { return new TestBot(getBotName(), host, port); } else if (princessRadiobutton.isSelected()) { Princess toReturn = new Princess(getBotName(), host, port, LogLevel.getLogLevel((String) verbosityCombo.getSelectedItem())); toReturn.setBehaviorSettings(princessBehavior); toReturn.log(getClass(), "getSelectedBot(String, int)", LogLevel.DEBUG, toReturn.getBehaviorSettings().toLog()); return toReturn; } return null; // shouldn't happen }
return; // user didn't click 'ok', add no bot if (clientgui.getBots().containsKey(bcd.getBotName())) { clientgui.doAlertDialog(Messages.getString("ChatLounge.AlertExistsBot.title"), Messages.getString("ChatLounge.AlertExistsBot.message")); //$NON-NLS-1$ //$NON-NLS-2$ Messages.getString("ChatLounge.AlertBot.message")); //$NON-NLS-1$ //$NON-NLS-2$ clientgui.getBots().put(bcd.getBotName(), c);