コード例 #1
0
ファイル: Program.cs プロジェクト: tgittos/starcraftai
        public static void Main(System.String[] args)
        {
            StarCraftAgent agent = new StarCraftAgent();
            ProxyBot proxyBot = new ProxyBot(agent);
            proxyBot.showGUI = false;

            try
            {
                proxyBot.start();
            }
            catch (SocketException e)
            {
                e.WriteStackTrace(Console.Error);
                System.Environment.Exit(0);
            }
            catch (System.Exception e)
            {
                e.WriteStackTrace(Console.Error);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: tgittos/starcraftai
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            StarCraftAgent agent = new StarCraftAgent();
            ProxyBot proxyBot = new ProxyBot(agent);
            proxyBot.showGUI = true;

            //Start the agent in it's own thread
            BackgroundWorker proxyBotBg = new BackgroundWorker();
            proxyBotBg.DoWork += new DoWorkEventHandler((object sender, DoWorkEventArgs e) =>
            {
                proxyBot.start();
            });
            proxyBotBg.RunWorkerAsync();

            //Sign up for the proxy bot connected event
            Toolbar toolbar = new Toolbar(proxyBot, agent);
            Application.Run(toolbar);
        }