using System; using System.Collections.Generic; using System.Windows.Forms; using Darwinbots3.CommonInterface.Modules; namespace Darwinbots3 { static class Program { /// /// The main entry point for the application. /// static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new BootScreen()); // Go find me a UI to boot! if (Core.Module != null && Core.Module.UserInterface != null) { if (Core.Module.UserInterface is IModuleWinforms) { IModuleWinforms winformsGui = Core.Module.UserInterface as IModuleWinforms; if (winformsGui.MainForm == null) { MessageBox.Show("Huh!? You've cocked up! The UI isn't ready! Exiting..."); } else { // Step 7) Pass main execution thread to the new UI instance Application.Run(winformsGui.MainForm); } } else { // Non Winforms UI, just a single XNA game window using a custom built XNA Gui // Or maybe even just a CommandLine UI!? MessageBox.Show("TODO: Make Xna based GUI"); } } else { MessageBox.Show("Pfft! No UI? You have't thought this though have you!"); } } } }