using System;
using System.Windows.Forms;

namespace WorldOfPeacecraft
{
	public class Program
	{
		static void Main()
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			Gui gui = new Gui();
			Backend backend = new Backend(gui);
			gui.SetBackend(backend);
			gui.CallComponentConstructors ();
			SplashScreen splash = new SplashScreen (gui,backend);
			splash.GuiHasLoaded += OnGuiLoaded;
			Application.Run (splash);
		}
		private static void OnGuiLoaded(SplashScreen screen, Gui gui){
			screen.BeginInvoke(new MethodInvoker(delegate {
				screen.Hide ();
				gui.Show ();
			}));
		}
	}
}

