package net.hexid.hexbot;

import java.util.Arrays;
import net.hexid.hexbot.bot.Bots;
import net.hexid.hexbot.bot.gui.BotGUI;
import net.hexid.hexbot.bot.cmd.BotCMD;

public class HexBot {
	public HexBot() {
		Bots.addBot("astral", "Astral WoW", "net.hexid.hexbot.bots.Astral", "net.hexid.hexbot.bots.AstralTab", "Astral.coffee");
		Bots.addBot("bing", "Bing Rewards", "net.hexid.hexbot.bots.Bing", "net.hexid.hexbot.bots.BingTab", "Bing.coffee");
		Bots.addBot("imgur", "Imgur Albums", "net.hexid.hexbot.bots.Imgur", "net.hexid.hexbot.bots.ImgurTab", "Imgur.coffee");
		Bots.addBot("molten", "Molten WoW", "net.hexid.hexbot.bots.Molten", "net.hexid.hexbot.bots.MoltenTab", "Molten.coffee");
		Bots.addBot("test-coffee", "Test-CF", "net.hexid.hexbot.bots.Test", "net.hexid.hexbot.bots.TestTab", "Test.coffee");
		Bots.addBot("test-js", "Test-JS", "net.hexid.hexbot.bots.Test", "net.hexid.hexbot.bots.TestTab", "Test.js");
		Bots.addBot("xbox", "Xbox Codes", "net.hexid.hexbot.bots.Xbox", "net.hexid.hexbot.bots.XboxTab", "Xbox.coffee");
	}

	protected void init(String[] args) {
		Bots.removeInvalidBots();

		// if there are no arguments of the first is `gui`
		if(args.length == 0 || args[0].equalsIgnoreCase("gui")) {
			BotGUI.init(Arrays.copyOfRange(args, (args.length > 0) ? 1 : 0, args.length));
		} else { // otherwise use the command line
			BotCMD.init(args);
		}
	}

	public static void main(String[] args) {
		HexBot hexbot = new HexBot();
		hexbot.init(args);
	}
}

@@ -262,22 +262,36 @@
 ot.bots.
-Astral
+cmd.generic.UserPass
 %22, %22net.
@@ -308,16 +308,20 @@
 ot.bots.
+gui.
 AstralTa
@@ -399,24 +399,28 @@
 hexbot.bots.
+cmd.
 Bing%22, %22net.
@@ -437,16 +437,20 @@
 ot.bots.
+gui.
 BingTab%22
@@ -525,24 +525,28 @@
 hexbot.bots.
+cmd.
 Imgur%22, %22net
@@ -564,16 +564,20 @@
 ot.bots.
+gui.
 ImgurTab
@@ -657,22 +657,36 @@
 ot.bots.
-Molten
+cmd.generic.UserPass
 %22, %22net.
@@ -703,16 +703,20 @@
 ot.bots.
+gui.
 MoltenTa
@@ -792,36 +792,50 @@
 xid.hexbot.bots.
-Test
+cmd.generic.NoArgs
 %22, %22net.hexid.he
@@ -836,32 +836,36 @@
 xid.hexbot.bots.
+gui.
 TestTab%22, %22Test.
@@ -933,20 +933,34 @@
 ot.bots.
-Test
+cmd.generic.NoArgs
 %22, %22net.
@@ -977,16 +977,20 @@
 ot.bots.
+gui.
 TestTab%22
@@ -1058,24 +1058,28 @@
 hexbot.bots.
+cmd.
 Xbox%22, %22net.
@@ -1096,16 +1096,20 @@
 ot.bots.
+gui.
 XboxTab%22

Update main launcher to use new classes for command line and gui interfaces