예제 #1
0
        public GUILauncher(
            GameToControllerWindowMessagePipe gameToControllerPipe,
            ControllerToGameMessagePipe controllerToGamePipe,
            GameApplication app )
        {
            OurGameToControllerPipe = gameToControllerPipe;
            OurControllerToGamePipe = controllerToGamePipe;
            OurGameApp = app;

            threadRunner = new Thread(this.DoWork);
            messagePumper = new Thread(this.PumpMessages);
        }
예제 #2
0
        static void Main(string[] args)
        {
            GameToControllerWindowMessagePipe pipeGameToController = new GameToControllerWindowMessagePipe();
            ControllerToGameMessagePipe pipeControllerToGame = new ControllerToGameMessagePipe();

            GameApplication app = new GameApplication(pipeGameToController, pipeControllerToGame);

            GUILauncher guiLauncher = new GUILauncher( pipeGameToController, pipeControllerToGame, app );
            guiLauncher.Run();

            app.Run();

            guiLauncher.Join();
        }
예제 #3
0
        public GameApplication( GameToControllerWindowMessagePipe pipe, ControllerToGameMessagePipe toGamePipe )
        {
            OurGameToControllerPipe = pipe;
            OurPipeControllerToGame = toGamePipe;

            game = GameState.LoadFromFile("partie.xml");

            // we dont activate the component at first because there is no window at the moment
            // we need to make a do change because when we recreate the window
            // the active component is initialized.
            ChangeComponent(new ThemeSelectionMenu(this ), false);
            DoChangeComponent();

            RecreateWindow();

            messagePumper = new Thread(this.PumpMessages);
        }